The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2017-07-10

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 zach joined #mojo
00:01 zach have you guys ever used https://metacpan.org/pod/Mojolicious::Plugin::RenderFile before?
00:02 zach my app is very minimal thus far and I'm getting inconsistent responses with that
00:03 zach sometimes it sends a 200 and the file, sometimes a 206 and then errs out, and sometimes a 416
00:07 Grinnz try https://metacpan.org/pod/Mojolicious::Guides::Rendering#Serving-static-files instead
00:12 Armen joined #mojo
00:16 zach Grinnz: I did but it didn't work when I tried it, while the other worked out of the box, 60% of the time lol
01:30 zach Grinnz: hmm, it kinda works now
01:31 zach other issues, but better
01:31 zach one less dependency
01:58 tchaves joined #mojo
02:11 noganex_ joined #mojo
02:30 schelcj joined #mojo
02:59 schelcj joined #mojo
03:09 schelcj joined #mojo
04:00 PryMar56 joined #mojo
05:20 sivoais joined #mojo
05:35 inokenty-w joined #mojo
05:40 eseyman joined #mojo
06:21 Lee joined #mojo
06:21 dod joined #mojo
06:26 dod joined #mojo
07:03 ribasushi sri, coolo: wondering how much of this sentiment do you share? https://news.ycombinator.com/item?id=14733844
07:04 AndrewIsh joined #mojo
07:13 karjala_ joined #mojo
07:17 dod joined #mojo
07:32 prg joined #mojo
07:38 dod joined #mojo
07:40 dod joined #mojo
07:43 sri ribasushi: i think the init system is generally liked, the rest... not so much
07:45 sri zach: if something in the core docs doesn't work it would be a bug
07:48 good_news_everyon joined #mojo
07:48 good_news_everyon [mojo] kraih tagged v7.36 at bd93227: https://git.io/vQPkh
07:48 good_news_everyon left #mojo
07:48 good_news_everyon joined #mojo
07:48 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vQPkj
07:48 good_news_everyon mojo/master 11d5987 Sebastian Riedel: bump version
07:48 good_news_everyon left #mojo
07:50 ribasushi nod
07:57 cosimo joined #mojo
08:11 marcus I like the init system, and starting to warm up to the journal
08:12 marcus not so pleased about the network or lxc bits
08:12 sri that's true, the journal is not bad either
08:36 rshadow joined #mojo
09:16 ribasushi joined #mojo
09:59 castaway joined #mojo
10:55 dod joined #mojo
11:11 Skrig joined #mojo
11:13 tchaves joined #mojo
12:59 karjala_ joined #mojo
13:14 gryphon joined #mojo
13:21 Lee joined #mojo
13:22 CandyAngel If I have a database that is being used by multiple applications, should I put something between the applications and the database?
13:23 zen multiple applications write to the same records?
13:24 CandyAngel Hmm.. yes, that could happen
13:26 zen I would look into some kind of record locking mechanism to prevent inconsistent results
13:28 CandyAngel The thing is, I will have a web front-end (for account management) and then the application.. and I forsee bad things happening if they are using different schemas
13:28 CandyAngel Though I've always wondered how database migrations work if the old version is still serving :P
13:40 gizmomathboy joined #mojo
13:46 jacobydave joined #mojo
13:55 kes joined #mojo
13:57 perlpilot joined #mojo
14:01 Pyritic joined #mojo
14:13 maschine joined #mojo
14:33 ptolemarch joined #mojo
14:45 jberger CandyAngel this is where writing a reusable model layer can be super handy
14:45 jberger (assuming the different applications are in the same language, ie perl)
14:47 dod joined #mojo
14:50 karjala_ joined #mojo
15:04 sri JavaScript is catching up with Perl :o https://developers.google.com/web/updates/2017/07/upcoming-regexp-features
15:09 CandyAngel jberger: I know how that is useful in general, but it doesn't solve that problem. If worker A spawned while using an old version, it'll continue using it even if worker B is spawned using the latest..
15:10 CandyAngel I presume you just don't do hot redeploys if the schema changes that significantly
15:18 jberger Oh I got ya know. Yeah likely have to do a real redeploy then
15:19 CandyAngel It's pretty exciting. Will have a usable server done soon!
15:20 CandyAngel At least, I can take a break from reverse engineering and just do some standard Mojo stuff (website for signing up and account management) :D
15:20 jberger If you really can't go down you'd have to do load balancer trickery pointing to different instances
15:23 CandyAngel Unless the other instances aren't using the to-be-updated database, not seeing how that would help either..?
15:24 CandyAngel If it does, I can actually do it "in protocol". The server can tell a client to reconnect to another address/port
15:28 jberger I only know the basic mechanics of this stuff, that's why I have devops people :-P
15:28 CandyAngel :P
15:30 CandyAngel I don't think people will mind the servers going down for updates, considering the alternative is not having the service at all
15:35 sri CandyAngel: yea, you either try not to break the schema so much old code stops working, or you take maintenance downtime
15:36 * CandyAngel nods
16:36 sh14 joined #mojo
16:56 dod joined #mojo
16:58 abra joined #mojo
17:11 PryMar56 joined #mojo
17:51 cosimo joined #mojo
18:19 gryphon joined #mojo
18:20 D joined #mojo
18:25 D I have javascript that opens a web socket (ws) and then works through a list of posts to my mojo webapp.  What is the best way to close the web socket connection?  Should the ws be closed client side via ws.onmessage using info from the server?
18:25 pink_mist I don't get the issue - close it when you're done.
18:25 pink_mist have the thing that knows when you're done do the closing.
18:26 pink_mist whether that's client or server depends on how you implement things
18:26 jberger ^^ ++
18:27 D I think I'm getting tripped up with the asynch in the client js.  I had it close within the .onopen call back (after processing the list), but this closed it before messages were received
18:28 D is it correct to send an "all done" from the server to tell the client to close it?
18:29 sri pretty standard
18:30 sri you design your own protocol on top of websocket
18:30 sri they're just transport
18:31 D thanks!
18:33 trwww joined #mojo
18:42 trwww joined #mojo
18:43 zivester joined #mojo
19:17 stryx` joined #mojo
20:04 dmanto joined #mojo
20:10 mcsnolte joined #mojo
20:11 dmanto hi, has anyone installed or try to install Mojo::Redis2 on v5.26.0?
20:12 preaction http://matrix.cpantesters.org/?dist=Mojo-Redis2
20:13 preaction here's for 5.26.0 specifically http://matrix.cpantesters.org/?dist=Mojo-Redis2;os=linux;perl=5.26.0;reports=1
20:13 preaction which... i should tell eserte that ; isn't special in urls anymore...
20:14 Grinnz heh
20:15 simbabque joined #mojo
20:16 simbabque are there best practices for unit-testing with https://metacpan.org/pod/Mojolicious::Plugin::Mail ?
20:16 simbabque I see it has an environment variable for not sending mail, but I wonder if I can change the transport layer somehow so I can grab it
20:16 simbabque and check if it sends the correct mails
20:17 preaction it returns the mail as a string always, so you could check that
20:17 simbabque when I call a controller action I don't have access to that I guess
20:17 preaction you could install your own helper, replacing the existing one (after testing that your app installs the right helper), with one that stores the mail somewhere
20:18 simbabque but it's Mime::Lite, so I can also just overwrite msg->send
20:18 simbabque hmm yes
20:19 preaction depending on MIME::Lite means that M::P::Mail could change and you wouldn't know. better to monkeypatch the API you're using, not the API being used by the API you're using
20:19 simbabque or I can just temporarily change the helper to simply see if it was called
20:20 simbabque true
20:20 preaction and with what arguments, is the point, yes
20:20 Grinnz that looks like another useless plugin as its functionality has nothing to do with mojolicious, and MIME::Lite is discouraged these days
20:20 simbabque I usually like Email::Stuffer
20:20 simbabque but I have to work with what's already there I guess
20:20 stryx` joined #mojo
20:20 preaction eh. it's a couple helpers that you'd otherwise have to write yourself
20:21 Grinnz if using the Email::Stuffer/Email::Sender stack you can simply set EMAIL_SENDER_TRANSPORT
20:21 Grinnz https://metacpan.org/pod/Email::Sender::Manual::QuickStart#Testing
20:21 Grinnz very easy for testing
20:22 simbabque I know
20:22 simbabque I'm using it with Catalyst and have a bunch of my own transports just for testing
20:25 simbabque does $app->helper("foo") return a coderef?
20:26 Pyritic joined #mojo
20:31 tchaves joined #mojo
20:42 Grinnz it's not documented to be usable that way
20:43 Grinnz $app->renderer->helpers will give you a hashref of name => $coderef though
20:44 Grinnz you probably want to be careful not to modify it
20:44 Grinnz actually, https://metacpan.org/pod/Mojolicious::Renderer#get_helper
20:45 dmanto preaction: about Mojo::Redis2, thanks for the links (should have know by myself, sorry). Installed a non-threaded 5.26.0 perl and it works. Anyway I would need the threaded version
20:45 preaction you have mojolicious running in a threaded context?
20:46 dmanto well, not using the threads inside Mojolicious
20:46 dmanto but the perl that runs Mojolicious is threaded, yes
20:46 preaction i mean, you have Redis, so it would likely be pretty easy to split your app up into non-threaded and threaded
20:47 preaction otherwise, i suspect the author of Mojo-Redis2 would accept patches that fix the threading problems, if it's possible
20:47 preaction it might just need to update Devel-PPPort
20:47 dmanto well, I am trying to get ride of the threads, so probably in the meantime I should keep the threaded version
20:47 Grinnz i think that batman is still looking for someone to take over development of Mojo::Redis2
20:48 dmanto ah yes you are right, I could have two different perls for the treaded part and for the rest
20:48 dmanto and eventually everything will be non-threaded
20:51 preaction it's annoying to have to manage two perls, of course. perlbrew or plenv can help with that. (i used to have to manage 32-bit only libs linked against perl, which was a blast)
20:52 dmanto yes indeed
20:52 dmanto I am using plenv
20:53 dmanto but I have to think how to modify the systemd service files
20:53 batman Grinnz: I've already given commit but away, but I'll give it to more people if they submit a PR that makes sense :)
20:56 * sri is very careful not to create too many projects these days... because finding new maintainers is hard
20:57 sri and there's only so many you can maintain yourself
20:57 rshadow joined #mojo
20:58 dmanto batman: I actually have no idea on what the problem could be. I run cpanm -v and it is not failing in the same places that are mentioned on the CPAN Testers Matrix
21:01 batman Yeah, I'm not sure either. I've considered skipping tests on CPAN, since I think the smokers have local settings messing up.
21:01 preaction that sounds like a good place for a new maintainer to start
21:02 preaction if your business depends on this software, it sounds like they should donate some time to its continued operation
21:06 dmanto yes you are right
21:08 CandyAngel I hate systemd so much
21:08 preaction i mean, i'm right, but they won't see it that way :p
21:09 preaction CandyAngel: a new reason?
21:09 purl rumour has it a new reason is because POSIX calls give me a return
21:09 CandyAngel "shutdown -h now" ... "cgroup: remount is not allowed *freeze*"
21:09 CandyAngel Can't even reboot with it
21:10 preaction oh. yeah. i can't restart apache on www.cpantesters.org, and i can't restart the server either. so i just leave it, since it's technically working...
21:10 preaction (apachectl still works, which is nice, but makes systemd even more angry)
21:10 CandyAngel I'm not even using cgroups, it's a fresh install.. need to move to Gentoo :|
21:18 dmanto oops now it installs in 5.26.0 multi-threaded
21:19 CandyAngel I just tried it again without changing anything.. message still comes up, but it works fine. Yay! Supposedly standard behaviour randomly doesn't work, it's just like using Windows again!
21:19 * CandyAngel switches back to Win2K
21:27 cosimo joined #mojo
21:52 Peppard joined #mojo
23:04 dmanto preaction, batman: Mojo::Redis2 issue seems to be related to some race condition, that's why when I retried one of the times it passed
23:05 dmanto I am getting some error related to global destruction in t/protocol.t
23:06 dmanto destroying object while queue for resolver has 2 elements during global destruction.
23:06 dmanto I get it twice.
23:07 dmanto Then if I run the test inside the debugger (perl -dIblib/lib t/protocol.t)
23:07 dmanto or if I add an ugly 'sleep 1' at the end of the test,
23:07 dmanto it passes
23:08 dmanto I think it is related to the Test::More changes
23:08 dmanto as a matter of fact, if I replace 'use Test::More' by 'use Test2::V0' it passes all the time
23:09 dmanto not sure if you would accept a pull request like this one.
23:16 Grinnz is your Test::More up to date? it's a wrapper around Test2 now, maybe the wrapper is buggy
23:17 Grinnz also what version of perl... global destruction issues vary a lot with perl version
23:35 gizmomathboy joined #mojo
23:37 dmanto yes I read something that Test::More is a wrapper now, thats why I thought it may be related
23:37 dmanto we were talking about 5.26.0 with threads
23:39 dmanto preaction directed me to the Perl testers matrix, and there I saw that for some threaded versions of 5.26.0 there were failed tests
23:39 Grinnz i think it would be a good idea for more things to use Test2 directly, but it's up to whether someone wants the test dependency, as Test2 isn't core until 5.26 and Test2::V0/Test2::Suite aren't core at all
23:40 dmanto do you think I should issue a PR?
23:44 dmanto mmm I don't understand, if Test2::V0 is not core, but Test::More is, and it is a wrapper around Test2::something...
23:47 Grinnz Test2 is core
23:47 Grinnz Test2::V0/Test2::Suite, the user tools for using Test2, aren't
23:48 Grinnz the Test::More wrapper uses the test-builder tools
23:48 Grinnz which are core
23:49 Grinnz basically, there is https://metacpan.org/release/Test-Simple which is core, and https://metacpan.org/release/Test2-Suite which isn't
23:50 Grinnz the core version of Test-Simple didn't include Test2 at all until 5.26 though

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary