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

IRC log for #mojo, 2017-02-18

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

All times shown according to UTC.

Time Nick Message
00:18 sugar joined #mojo
00:42 disputin joined #mojo
01:11 aborazmeh joined #mojo
01:28 figaro joined #mojo
01:43 miller joined #mojo
01:48 miller I'm testing hot deployment of hypnotoad to up the number of workers configured in api.pl from 4 to 10.
01:48 miller It appears to work, as 10 more workers spawn up while the original 4 are still taking requests.  It goes through my standard precaching of data for each worker, but at the end I get "Zero downtime software upgrade failed" in the mojolog, and each new worker dies off one at a time.
01:48 miller Is there anywhere else I should look for clues for why the hot deployment failed?
01:52 asarch joined #mojo
01:53 cpan_mojo Mojo-IRC-0.44 by JHTHORSEN https://metacpan.org/relea​se/JHTHORSEN/Mojo-IRC-0.44
02:01 aborazmeh joined #mojo
02:04 miller Figured it out.  workers were taking up too much memory.
03:33 noganex joined #mojo
03:35 howitdo joined #mojo
04:41 stryx` joined #mojo
05:04 dboehmer joined #mojo
06:12 lluad joined #mojo
06:50 Vandal joined #mojo
07:04 sh14 joined #mojo
07:17 dantti_laptop|2 joined #mojo
07:25 sugar joined #mojo
08:44 kes joined #mojo
09:13 lluad joined #mojo
09:39 stryx` joined #mojo
10:03 kaare joined #mojo
10:50 ladnaV joined #mojo
10:56 someguy joined #mojo
11:08 irqq_ joined #mojo
11:12 cpan_mojo Mojo-RabbitMQ-Client-0.0.9 by SEBAPOD https://metacpan.org/release/SEB​APOD/Mojo-RabbitMQ-Client-0.0.9
11:48 sugar joined #mojo
12:11 batman joined #mojo
12:37 sri so, i guess this should be accepted? https://github.com/kraih/mojo-pg/pull/39
12:55 rshadow joined #mojo
12:57 stryx` joined #mojo
13:36 stryx` joined #mojo
13:46 sri yes
13:47 someguy In what situation would mojo decide that something was a 404 after dispatching to a route that only calls ->render?
13:48 someguy is that just the default in the stash?
14:12 px80 good morning sunshines!
14:13 px80 I have a design question
14:14 px80 using delay with some subs where each is call after the previous one has finished, so pretty rudimentar standard stuff
14:15 px80 now I want that the next sub is not doing more $ua->gets in parallel than N
14:15 px80 how would you suggest to do that
14:16 px80 all previous subs hadn't the problem of "too many http requests in parallel", but in this sub this would end up in a quite serious DoS
14:17 px80 do I need to create another delay object inside this delay object?
14:19 someguy Sounds like you need a pool to limit yourself to N concurrent requests
14:22 pink_mist px80, something like: my @steps; while (@urls) { my $urls = [ splice @urls, 0, $N ]; push @steps, sub { $ua->get($_, $_[0]->begin()) for @$urls }; } $loop->delay(@steps); # completely untested, and I didn't even look at any documentation so I might have completely missed which things gets passed where
14:23 batman joined #mojo
14:30 stryx` joined #mojo
14:32 sri there's a pool example in the docs http://mojolicious.org/perldoc/Mojol​icious/Guides/Cookbook#Non-blocking
14:35 px80 ok thanks
14:35 px80 this might help both
14:37 px80 although its stil a bit unclear if its even possible to all this inside a single delay sub
14:37 px80 as the sub itself is normally single delay loop/pool
14:39 asarch joined #mojo
14:41 px80 seems I need to create a dedicated delay object for this
14:47 sri don't even try nested closures
14:47 px80 ok
14:48 sri just abstract it out so you end up with something like ->delay(..., sub { my ($delay, @urls) = @_;  _my_super_cool_parallel_downloader(\@urls, $delay->begin) }, ...)
14:49 sri then you have a callback you can call once downloading is done
14:51 pink_mist sri: is there anything inherently wrong with my approach? (aside of anything I missed because I didn't check docs? :P)
14:53 sri pink_mist: it assumes a non-changing queue as far as i can see, which is pretty rare
14:54 pink_mist ah, that's a good point =)
14:54 sri but yea, if the list of urls is static it should work
15:35 sh14 joined #mojo
16:29 sugar joined #mojo
16:52 lluad joined #mojo
16:53 lluad left #mojo
18:16 PryMar56 joined #mojo
18:28 sh14|2 joined #mojo
18:30 jnbek joined #mojo
18:32 sri hope this is enough to get people to vote https://github.com/kraih/mojo/p​ull/1053#issuecomment-280864110
18:32 sri otherwise i'll reject the pull request for lack of voters
18:39 marty_ joined #mojo
18:40 sri well... https://github.com/kraih/mojo/p​ull/1053#issuecomment-280865911
18:42 polettix joined #mojo
18:53 sh14 joined #mojo
19:24 sugar joined #mojo
19:38 stryx` joined #mojo
19:46 litwol Hello
19:47 litwol Is there a recommended way of sending emails via mojo? i saw several tutorials online, but htey are several years old.
19:48 litwol 9/2015 http://perltricks.com/article/193/2015/9/18/How​-to-send-verification-emails-using-Mojolicious/
19:49 Grinnz litwol: nothing in mojo is really relevant to sending emails. i recommend Email::Sender::Simple or Email::Stuffer
19:49 litwol ty
19:49 Grinnz the latter if you want to send attachments is really nice
19:49 Grinnz and Email::Stuffer just uses Email::Sender::Simple itself, so you can still override the transport
19:57 litwol What is perl's or mojolicious' method of dependency resolution? something equivalent to 'npm/composer install' ?
20:01 Grinnz cpan or cpanm
20:01 Grinnz no 'install', just package names
20:01 Grinnz the http://mojolicious.org/ installation instructions use cpanm
20:02 Grinnz you can install cpanm to your perl as App::cpanminus
20:02 litwol well. i mean. how do 'distributable' apps provide list of own dependencies and methods for installing them?
20:02 Grinnz depends, if you're distributing it on CPAN or on its own
20:03 litwol its own
20:03 Grinnz a cpanfile is usually a good method
20:03 Grinnz https://metacpan.org/pod/distributi​on/Module-CPANfile/lib/cpanfile.pod
20:03 Grinnz cpanfiles can be used by cpanm
20:03 pink_mist if all your deps are pure-perl you can fatpack them
20:06 litwol will google those.
20:06 litwol i'm just building a little site for myself. keeping things in self hosted gitolite.
20:06 litwol and i want to be able to clone my repo, then run some dependency resolution command.. and be done.
20:07 pink_mist cpanm with a cpanfile would work well for that
20:07 litwol great. ty
20:20 stryx` joined #mojo
20:38 cpan_mojo Mojo-SQLite-2.001 by DBOOK https://metacpan.org/relea​se/DBOOK/Mojo-SQLite-2.001
20:38 stryx` joined #mojo
20:49 sri seriously? now Grinnz even releases bug fixes before me? :O
20:49 litwol "Plugin "Minion" missing, maybe you need to install it?"
20:49 litwol :(
20:49 litwol http://mojolicious.org/perld​oc/Mojolicious/Plugin/Minion
20:49 Grinnz i was about to add the name_sep before anyway :P
20:50 sri Grinnz++
20:51 litwol i'm attempting to load minion using this line: $self->plugin(Minion => {Pg => $config->{db_dsn}});
20:52 litwol i am already using '$config->{db_dsn}' in another place.. so that can't be the fault.
20:52 litwol Do i need to add 'use something::something::Minion' ?
20:54 sri did you install Minion?
20:55 litwol I did not perform any special steps before this.
20:55 sri http://mojolicious.org/perldoc#SPIN-OFFS
20:55 litwol oh
20:55 litwol thank you
20:56 litwol already loving cpanfile.
21:41 litwol Is it possible to auto restart minion workers, akin to what Morbo does, when files change?
21:46 sri no
22:50 litwol Grinnz: ty for mention of Email::Stuffer. works nicely.
23:32 itaipu joined #mojo
23:33 hartenfels joined #mojo
23:58 cpan_mojo Mojo-Pg-3.02 by SRI https://metacpan.org/release/SRI/Mojo-Pg-3.02

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