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

IRC log for #mojo, 2016-02-02

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

All times shown according to UTC.

Time Nick Message
01:00 jontaylor joined #mojo
01:13 Adura joined #mojo
01:13 noganex joined #mojo
01:13 jacoby_ joined #mojo
01:13 csson joined #mojo
01:14 orev joined #mojo
01:14 KindOne joined #mojo
01:14 bc547 joined #mojo
01:15 Gedge joined #mojo
01:15 anparker joined #mojo
01:15 FatalNIX joined #mojo
01:15 diegok joined #mojo
01:16 Ralesk joined #mojo
01:20 lestrrat joined #mojo
02:00 jontaylor joined #mojo
02:02 Kogurrr joined #mojo
02:23 jberger that's an interesting optimization
02:23 jberger why does it need a dummy and could it not be cached?
02:25 Grinnz it's another attempt by haarg at what he was doing before, this one avoids the deprecation warning
02:26 Grinnz previous attempts https://github.com/kraih/mojo/commit/6a3268cc9bc6c345d06f296d237ba4ca8aefea14 and https://github.com/kraih/mojo/commit/1fecf6939955996948f884deb575e929e458693f
02:27 Grinnz https://github.com/makamaka/JSON-PP/pull/18
02:33 jberger interesting
02:33 jberger I still think that $dummy could be declared only once though
02:34 jberger not sure how micro-optimized that is, but it seems like an easy thing
02:34 Grinnz $dummy isn't for optimization, it's because of weirdness
02:34 jberger no, I get that
02:34 jberger but declare it once in the file scope and be done with it
02:34 Grinnz i only see it there once
02:34 Grinnz oh
02:35 jberger though I guess that creates a closure
02:35 jberger which might not be any better
02:35 bpmedley joined #mojo
02:45 jberger Oo https://github.com/haarg/JSON-PP/blob/87bd6a49bacc3a2634cbb1dd0ce9cc75675bb524/lib/JSON/PP.pm#L1336-L1340
02:53 jberger why can't that reuse existing UNIVERSAL methods?
03:00 haarg because they might be overridden by the class
03:01 haarg jberger: $dummy has to be explicitly set per run.  it can't be set once at file level.  so declaring at a larger scope would be pointless.
03:02 haarg the point of dummy is that we operate on a copy rather than the raw "" value
03:02 jberger ah
03:03 haarg because on old perl, the & operation will change the flags on the actual "" literal
03:03 jberger as soon as you said that I assumed something similar
03:23 mcsnolte joined #mojo
03:24 Grinnz "because on old perl, ..." where ... is something absurd
03:30 inokenty-w joined #mojo
03:32 noganex_ joined #mojo
04:37 c--__ joined #mojo
04:56 disputin joined #mojo
04:56 da5id joined #mojo
05:13 mattp_ joined #mojo
06:26 Vandal joined #mojo
06:34 davido joined #mojo
06:35 Phil21 hmm
06:37 Phil21 https://gist.github.com/anonymous/76adfd6450a6ae51256f
06:38 Phil21 so.. trying to wrap my head around IOLoop->delay a little
06:38 Phil21 in that example attempting to just "process" a list of URLs
06:38 Phil21 but.. obviously on the wrong path here, hrm
06:48 Grinnz Phil21, no new. pass subs to the ->delay method itself https://metacpan.org/pod/Mojo::IOLoop#delay
06:48 Phil21 well, removed new that was me futzing, same error though
06:49 Grinnz what error?
06:49 Grinnz and there's no begin event, and you don't really need the finish event, just add another step
06:50 Phil21 yeah, I obviously don't understand this stuff at all :)
06:50 Grinnz the first example in the section i linked is basically what you need, just with $ua->get instead of timers
06:50 Phil21 I jhttp://blogs.perl.org/users/joel_berger/2013/11/writing-non-blocking-applications-with-mojolicious-part-2.html
06:50 Phil21 was basing it off that
06:50 Phil21 hrm, okay
06:52 Grinnz https://metacpan.org/pod/Mojolicious::Guides::Cookbook#Concurrent-blocking-requests another example
06:53 Phil21 alright, yeah I don't understand the ->on(finish stuff then even a little yet
06:54 Grinnz the finish event or the next step is called once the first set of events have all completed
06:54 Phil21 ah, ok
06:54 Phil21 that makes a lot more sense :)
06:54 Grinnz you indicate you're waiting for an event by calling $delay->begin, and once the callback it returns gets called (by the user agent) that indicates it's done
06:55 Phil21 yeah, I guess calling ->begin multiple times was confusing to me
06:55 Phil21 let me hack this out, that last example helps a lot
06:55 Phil21 thanks
06:55 Grinnz ive never liked begin as a name but i wasnt able to come up with one that everyone likes
06:58 bjakubski joined #mojo
06:59 dod joined #mojo
07:04 dod joined #mojo
07:05 Phil21 hmm, closer!
07:06 Phil21 it's making all the requests, but I only seem to be able to get the "callback" (if that's the right word?) to fire once
07:06 Phil21 man, it's fast at least!
07:07 Phil21 https://gist.github.com/anonymous/a77a4dea225531a88c93
07:10 jontaylor joined #mojo
07:13 irqq joined #mojo
07:14 bpmedley Phil21 : Excuse my ignorance, seems your try to process a lot of files for downloads concurrently?
07:14 bpmedley *trying
07:15 Phil21 bpmedley: pretty much, just a random "problem" to try to wrap my head around ioloop::delay
07:15 bpmedley Ok, does the code work for one file?
07:15 Phil21 yeah
07:15 Phil21 that code there is actualy grabbing all the ursl
07:15 Phil21 urls
07:15 Phil21 it's just not printing out the response so I can do something with $ua->res
07:16 Phil21 (what I need to work with, per-request)
07:16 Phil21 it only prints the first url in the array, then exits
07:16 Phil21 which I thought the ->wait would cause it to wait for all threads
07:16 Phil21 but with useragent debug on, it defintiely gets all 10 (what is in @urls) urls
07:16 Phil21 so kinda confused, obviously still not completely grasping the concept
07:18 bpmedley You might understand the concept, and there could be some IOLoop semantics that are difficult.  Do you have an example script with data for one URL?
07:19 Phil21 there isn't much code to make work for one url
07:20 Phil21 it's literally say $ua->req->url and the status code :)
07:20 bpmedley Sure, I'm just asking for the complete script.
07:20 Phil21 https://gist.github.com/679ba6b9df390e160d74
07:20 Phil21 that maybe?
07:20 Phil21 eh, it's long
07:20 Phil21 but that is pretty standalone, sec
07:22 Phil21 https://gist.github.com/anonymous/1390a5d2f7d271d9efa4
07:22 Phil21 there we go
07:23 Phil21 exhibits behaviour
07:28 bpmedley Phil21 : http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Concurrent-blocking-requests <-- Is this what you want to do?
07:28 sugar__ joined #mojo
07:28 Phil21 yep
07:29 Phil21 I'm interested to know how I didn't accomplish that
07:29 bpmedley Let me think
07:30 bpmedley Phil21 : How many steps does your app create?
07:30 Phil21 literally just this script doesn't work
07:30 Phil21 I'm curious intellectually to understand why
07:32 Phil21 hehe, copying in the example code fails too, just with a more spectacular error
07:33 bpmedley What's your script look like with code from the cookbook?
07:33 Phil21 https://gist.github.com/93354c458898fc85d80d
07:34 bpmedley Change the URLs to slashdot.org and google.com, if you would..
07:34 cpan_mojo Mojo-SinaWeibo-1.6 by SJDY https://metacpan.org/release/SJDY/Mojo-SinaWeibo-1.6
07:34 Phil21 not sure that's gonna help this error
07:34 Phil21 Mojo::Reactor::Poll: I/O watcher failed: Can't locate object method "say" via package "Mojo::Transaction::HTTP" at test2.pl line 10.
07:34 bpmedley use Mojo::Base -strict;
07:34 Phil21 (example code pasted right in, haven't debugged at all)
07:35 bpmedley So, a couple things: add the -strict and change the URLs.
07:36 Phil21 https://gist.github.com/a1c4456913eef9161471
07:36 Phil21 shows same https://gist.github.com/a98c1ae0af256b3ac60c
07:36 Phil21 sorry, that one
07:37 bpmedley Phil21 : $mojo is the ua for get #1 and $minion is the ua for get #2
07:37 bpmedley Perhaps badly named with the URL change
07:38 Phil21 ah, yeah
07:39 bpmedley I guess the only thing you lacked from your original gist was a loop that did the "say"?
07:40 Phil21 well, this is still failing though in my code
07:40 Phil21 with $minion instead
07:40 Phil21 (need to figure out that magic)
07:40 Phil21 gets me first url again
07:40 Phil21 bleh, wtf
07:40 Phil21 probably just tired :)
07:40 bpmedley Just a sec..
07:41 bpmedley Does your original code with $delay->on(finish work?
07:41 Phil21 nope
07:41 Phil21 I removed the on(finish stuff too
07:41 Phil21 just to narrow it down
07:41 bpmedley May I see the latest?
07:42 Phil21 https://gist.github.com/720c30a335df82f1de33
07:43 bpmedley Between line 8 and 9 <-- Add a $mojo say
07:45 Phil21 oh, shit
07:45 Phil21 I see
07:45 Phil21 fun
07:45 bpmedley :-0
07:45 Phil21 guess I just figured the magic vood out
07:45 Phil21 voodoo
07:45 * Phil21 removes comment
07:49 bpmedley Phil21: Does the fact that $delay->begin returns a callback make sense?
07:53 Phil21 no, not really yet
07:54 Phil21 all delay-begin means to me right now is how I add a "job" to my async queue
07:54 bpmedley Understood.  That took me a while..
07:55 bpmedley How does delay->wait know when to "stop"?
07:55 Phil21 like whenever a timeout is hit, or all the ua transactions complete
07:55 Phil21 likely even
07:55 bpmedley http://mojolicious.org/perldoc/Mojo/IOLoop/Delay#begin
07:55 Phil21 but that's just a guess :)
07:55 bpmedley Indicate an active event by //incrementing the active event counter//
07:55 Phil21 ah, ok so increments the event coutner
07:55 bpmedley What does the callback do?
07:55 Phil21 and end decrements, I presume
07:55 * Phil21 looks
07:56 bowtie joined #mojo
07:57 odc joined #mojo
07:57 bpmedley After both counters are done, then the "active" event counter will be zero.  And, then, we will be done with the current $delay step.
07:57 bpmedley Make sense?
07:58 Phil21 kinda
07:58 bpmedley Which part is confusing?
08:00 Phil21 well, I'm guessing $ua->get's callback automatically handles the decrement?
08:00 Phil21 like I don't see where the callbacks are... called back
08:00 bpmedley That's what confused me for a long time.
08:00 bpmedley $delay->begin is a subroutine that returns the $cb to run at the end.
08:01 bpmedley It's a begin that creates the end.
08:03 bpmedley http://pastie.org/10705177 <-- See the expanded line 20 - 23?
08:04 Phil21 yeah
08:04 bpmedley Does that make sense?
08:04 Phil21 kinda, think I'll have to mess with it more in the morning
08:05 Phil21 on an easier note, any recommendations for a "human" readable bytes -> display module?
08:05 * Phil21 cpans
08:05 bpmedley bytes?
08:06 Phil21 e.g. you feed it bytes, it prints out 56B, 104K, 140M, 555G, etc.
08:06 Phil21 http://search.cpan.org/~ferreira/Number-Bytes-Human-0.07/Human.pm
08:07 bpmedley https://github.com/brianmed/disk_report/blob/master/disk_report.txt#L11
08:22 bowtie joined #mojo
08:33 AndrewIsh joined #mojo
08:34 bowtie_ joined #mojo
08:36 trone joined #mojo
08:53 Lee sri: https://gist.github.com/leejo/656dca61264d3480de81 # re. the routing query yesterday. i don't know if this makes sense?
08:57 frantracer joined #mojo
08:59 bowtie_ joined #mojo
09:05 bowtie_ joined #mojo
09:13 abraxxa joined #mojo
09:13 abraxxa left #mojo
09:18 frantracer hello! I am working with Mojolicious::Lite and I want to enable SSL/TLS in the server side, but I cannot find any documentacion about how to do it
09:18 frantracer I did find how to enable in the client side with Mojo::UserAgent, but not the server
09:19 frantracer Has someone an idea about how to do it? Thanks in advance!! :)
09:21 berov joined #mojo
09:23 CandyAngel frantracer: If I recall from the docs correctly, SSL is enabled automatically
09:23 CandyAngel You just need to start your server on https
09:23 CandyAngel ./my_app.pl daemon -l https:// ... or something like that
09:24 kes joined #mojo
09:24 CandyAngel http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Basic-authentication1
09:25 CandyAngel Has an example at the bottom I believe
09:25 frantracer ahh, ok. I will try. Thank you very much :)
09:26 CandyAngel My pleasure, please let me know how it goes :)
09:26 frantracer I will
09:27 kes http://paste.scsys.co.uk/504956
09:27 kes Is there short cut in Mojolicious for that?
10:04 frantracer hello again, ssl authentication worked by adding "-l https://*:3000" as an argument indeed. However, does exist a way to do the same in the code??
10:05 frantracer by the way thanks to CandyAngel again for the advice :D
10:14 dvinci joined #mojo
10:17 CHYC kes: I'm not 100% sure what you're after. Wouldn't an "if {} else {}" work?
10:17 kes Yes, this works, but I am interesting at return ( for the future)
10:17 kes may be '%= apply'
10:19 kes sometimes better: 'return "VALUE"   unless()' instead of ugly long if(){}else{}
10:20 CHYC Ah, the penny drops, thanks :)
10:21 CandyAngel frantracer: Glad to hear it worked. What do you mean "in code"?
10:22 CandyAngel frantracer: Like.. this? http://mojolicious.org/perldoc/Mojo/Server/Daemon#listen
10:24 kes I think before that $_O is something global and was surprised the just return throws out generated contend. Looking at the generated code I understand why. So I feel that would be handy to have short cut for 'return Mojo::ByteStream->new($_O)'
10:37 sri hey! i want more pictures of the mojo stickers!
10:43 ashimema hmm.. Morbo has just started to spew: 'Mojo::Reactor::EV: I/O watcher failed: Bad arg length for Socket::unpack_sockaddr_in, length is 28, should be 16 at /home/rebus/.plenv/versions/5.20.2/lib/perl5/site_perl/5.20.2/x86_64-linux/Socket.pm line 831.' on app start
10:44 ashimema is this a common one.. I'm not sure where to start to fix it.
10:45 sri you should be able to find that in the irclog
10:46 * ashimema goes digging.. thanks sri
10:47 sri is your mojolicious old?
10:47 ashimema nope..
10:47 ashimema that's the first thing I checked.
10:47 ashimema it's the latest.. running on perl 5.20.2
10:48 ashimema with IO::Socket::SSL 2.023 (which i think is also the latest)
10:48 ashimema just searhcing the irc logs now
10:48 sri i vaguely remember that error from old versions of IO::Socket::SSL
10:51 ashimema seems to have popped up a couple of times over the last year
10:53 ashimema ipv6 issue it seems
10:53 ashimema and assetpaker
10:55 ashimema installing IO::Socket::IP fixes it.
10:55 ashimema might be worth making a note of that one somewhere in the docs?
10:55 sri what was the old version?
10:55 sri https://github.com/kraih/mojo/blob/master/Makefile.PL#L36
10:56 sri we already require a sepcific version
10:56 ashimema hmm
10:56 ashimema not sure how I can tell what the old version was :(.. unless you know of a way..?
10:57 ashimema hang on..
10:57 ashimema I'm being dence
10:57 nic ashimema: Do you use cpanm?
10:57 ashimema Successfully installed IO-Socket-IP-0.37 (upgraded from 0.29)
10:57 ashimema yes.. i use cpanm
10:57 sri umm
10:57 sri did you install mojolicious with cpanm?
10:57 ashimema interesting.. why did my cpanm not grab .37 when i installed Mojolicious then?
10:58 ashimema haha.. you asked yourself the same question as me there
10:58 nic You installed it with the same perl in your path, and the same PERL5LIB?
10:59 ashimema it's a plenv + carton setup
10:59 sri you messed up somewhere
10:59 ashimema on a dev machine.. so using 'carton upgrade' pretty frequently to check for breaking changes in my dependancies
10:59 ashimema mm.. must have done somewhere
11:00 ashimema thanks for your assistance guys
11:26 frantracer OK, CandyAngel, I finally did it! I added app->start('daemon', '-l', 'https://*:3000'); The problem was that I was using morbo and it overwrites the arguments, so if I use morbo I have to add these parameters to the morbo call. Thanks for your time :)
11:36 CandyAngel frantracer: Glad I could help :)
11:36 CandyAngel sri: Can I have some advice from you regarding API design?
11:47 sri http://www.homerbackingintothings.com/static/images/homer.gif
11:53 CandyAngel It's only a quick one, I promise :)
11:53 CandyAngel Which style would you code: http://codepad.org/ETv31MLe
11:54 bpmedley $device->matrix->projection->left;
11:55 bpmedley $device->matrix->identify
11:55 bpmedley *identity
11:55 CandyAngel bpmedley: That too :P
11:57 CandyAngel I'm welcome to a better way in general though
11:57 CandyAngel Doesn't have to be the two I've given there
12:00 sri former
12:01 sri i rarely use boolean args
12:02 CandyAngel Okie dokie
12:02 kaare joined #mojo
12:02 bc547_ joined #mojo
12:03 CandyAngel I've been considering quite a few ways of doing it. I want it to be nicer to use than the thin C wrapper, after all :)
12:03 CandyAngel Like umm
12:03 CandyAngel $device->left_eye->projection_matrix
12:03 sri i always start by googling for inspiration
12:03 CandyAngel But I'm not sure
12:04 sri mostly in languages other than perl
12:09 CandyAngel I kind of like the idea of $device->left_eye because I could make a OpenHMD::Device::Eye base class and have the eye specific constants in ::Eye::Left and ::Eye::Right.. :\
12:10 CandyAngel But what will I do if we evolve another eye? It'll be a disaster
12:10 CandyAngel :P
12:13 good_news_everyon joined #mojo
12:13 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vgTVR
12:13 good_news_everyon mojo/master a5dbee7 Sebastian Riedel: use the same idiom consistently
12:13 good_news_everyon left #mojo
12:14 sri still on the edge about "if length $foo" vs "if $foo ne ''", think i like the latter better, but not by much
12:15 ribasushi sri: I just recently made a commit switching everything to length $foo
12:15 ribasushi as it's a single lookup into the length slot of the PV
12:16 ribasushi as opposed to the entire ne binary op setup
12:16 sri i've never been able to measure a performance difference
12:16 sri but interesting to hear from someone who knows the internals
12:16 ribasushi there likely isn't any in simple benchmarks, no
12:17 ribasushi but I was coming from a pov of "how much of the internal checks of other flags (e.g. utf8-ness, magick-ness, etc) will trash the cpu cache
12:18 ribasushi whereas (afaik) the length is specifically kept coherent in-PV
12:18 ribasushi this might be outdated info however, I'd ask a p5per if the difference needs to be known
12:34 sri hmm
12:37 * sri kinda would like to know of one is really better than the other :)
12:37 sri s/o/i/
12:41 asarch joined #mojo
12:53 batman sri: not sure if this is helpful: https://ssl.thorsen.pm/paste/c3702e3ba120
12:53 batman no idea why it says 1.75596 wallclock secs ...
12:54 batman it takes around ~25 seconds to run the benchmark...
13:00 Lee length has one less op
13:00 Lee sri: did you see my link above?
13:03 bzero joined #mojo
13:03 good_news_everyon joined #mojo
13:03 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vgTXk
13:03 good_news_everyon mojo/master d19e4fd Sebastian Riedel: length might be a little faster
13:03 good_news_everyon left #mojo
13:04 sri Lee: no
13:05 Lee https://gist.github.com/leejo/656dca61264d3480de81 # re the route stuff yesterday
13:05 * sri is trying to find out if he will be able to play xcom2 on his macbook air :o
13:06 sri Lee: sorry, not looking into that kinda gists anymore, if there's a bug please add somethig to t/mojolicious/routes.t or similar
13:06 sri the documentation is pretty clear about order of routes being very significant
13:07 sri you said earlier that something broke after a mojolicious upgrade
13:07 sri but nothing here suggests anything like that
13:09 Lee i *can* add a test but i want to know *if* it's a legitimate use case or not *before* i waste my time or yours, and yes the ordering of routes matters - but when i upgraded i bisected a break back to the aforementioned commit
13:09 smoker28 joined #mojo
13:10 Lee so i'm happy this was a bug in our app, but just wanted to highlight it that's all (before the routing order didn't matter as much, now it does)
13:10 Lee anyway, we have a regression test now :)
13:10 sri fwiw. i don't understand the gist
13:11 smoker28 Smokers? Pvt me
13:11 Lee should /a/b/c/ match /a/b/:foo/:bar/ ?
13:16 sri no, there's a value for :bar missing
13:17 Lee okay, but it *does* when there's a value for foo defined
13:17 Lee i've reduced the test case even more on the gist
13:19 nic Lee: So you're saying that when you make the 'foo' an optional placeholder, the 'bar' gets matched
13:20 Lee nic: am i misunderstanding optional placeholders? does that urn reduce to /a/b/:bar in this example?
13:21 Lee ah, i think i am
13:21 sri could be a bug
13:21 Lee i see the docs say "if two optional placeholders are only separated by a slash, that slash can become optional as well"
13:22 nic but I didn't think you'd made the 'bar' optional
13:22 sri think i'd accept a patch to make it work the way you expected it to
13:22 sri it's more undefined behavior than bug though
13:23 nic I'm only scratching the surface, but so far it looks like undesirable behaviour fwiw
13:26 sri turns out it actually is intended
13:26 sri https://github.com/kraih/mojo/blob/master/t/mojolicious/pattern.t#L26
13:27 sri it would be easy to change on this line i believe https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Routes/Pattern.pm#L131
13:27 sri just add a "$optional && ..." to the front
13:28 Lee sri: ok, ta - and i think this behaviour had some (more?) edge cases that happened to be fixed if your routes weren't in order (the commit i bisected back to was c9b65981e8e64ed)
13:28 ribasushi sri: re earlier - it doesn't take that much internals knowledge to deduce with high certainty that this: https://github.com/Perl/perl5/blob/blead/pp.c#L3285-L3310 should be much cheaper than this: https://github.com/Perl/perl5/blob/blead/sv.c#L7658-L7729
13:29 sri ribasushi++
13:29 sri Lee: very intentional, since 2014 https://github.com/kraih/mojo/commit/f87ceab0a1f07c4ad3f9c47476c9f3b13b3a2879
13:30 ribasushi ( it took some asking on #p5p how strings are compared, as apparently PP_eq implements '==' while PP_seq implements 'eq' </facepalm> )
13:31 sri Lee: your app might have worked accidentally because of a little quirk, like a slash at the end not being optional or so
13:31 ribasushi with (for completeness) ilmari's hint of the easy answer to such questions: perl -MO=Concise -e '$a eq $b'  (displays 'seq' among other things )
13:33 Lee sri: yes, we had a couple of routes that were out of order due to optional placeholders (we have about 300 routes) so we didn't pick up on this until yesterday
13:33 Lee as i said, something to keep in mind. ta!
13:35 nic I would like to retract my comment about "undesirable behaviour"
13:35 sri hehe, and i would like to retract my comment about accepting a patch
13:35 sri in context, this is definitely desirable behavior
13:36 nic yeah, it took me a while to get my head around it
13:36 sri memories are coming back... the change was very popular back then
13:36 nic but if 'foo' is optional, I wouldn't want the proposed test to pass
13:36 sri specifically this doc change https://github.com/kraih/mojo/commit/f87ceab0a1f07c4ad3f9c47476c9f3b13b3a2879#diff-5673597847bee81d4615bbe62681edffL352
13:37 sri i remember how annoying that limitationw as at times
13:37 sri and how many questions it caused
13:38 nic yeah, I remember some of the discussion on here
13:40 good_news_everyon joined #mojo
13:40 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vgTHk
13:40 good_news_everyon mojo/master c6f119f Sebastian Riedel: remove deprecated format_regex attribute from Mojolicious::Routes::Pattern
13:40 good_news_everyon left #mojo
13:41 nic Is it true that javascript was invented by malevalent government agencies to throttle coders' productivity?
13:53 smoker28 left #mojo
13:59 CandyAngel Yes
14:01 stryx` joined #mojo
14:05 CandyAngel Hm, I don't really need subclasses in this case, providing I make the constants they use into attributes
14:06 marcus fucking fatpacker
14:06 marcus :-/
14:06 jberger wow marcus, tell us how you really feel
14:07 marcus oops, language. sorry
14:07 marcus but really
14:07 marcus it's no fun when it breaks
14:08 jberger I've never used it for anything but trying it out
14:08 neilhwatson joined #mojo
14:25 CandyAngel Is it "proper" for me to do: has some_constant => sub { die 'Constant not defined in subclass' };?
14:33 stryx` joined #mojo
14:34 Trelane_ joined #mojo
14:48 mcsnolte joined #mojo
14:55 gryphon joined #mojo
15:08 punter joined #mojo
15:16 jberger https://twitter.com/PerlTricks/status/694516438183313412
15:17 jberger CandyAngel: you can do that, but since has is a rw attribute it would only fail if it isn't set by the user or overridden
15:17 jberger I often do "has thingy => sub { die 'thingy is required' }
15:17 jberger if you want it to unconditionally die unless overridden use sub
15:17 jberger sub thingy { die 'thingy not overridden by subclass' }
15:21 vicash Hello. Suppose I enqueue jobs using Minion and none of the workers have been started, will the jobs fail and return ?
15:22 vicash or will they be waiting and when a worker starts up, automatically start finishing up
15:22 Grinnz CandyAngel, that may indicate you're looking for a role
15:23 Grinnz Role::Tiny is magic ;)
15:24 jberger vicash: they will sit in the "inactive" state until the workers start
15:24 vicash jberger: awesome
15:26 vicash jberger: does that mean that using Minion I can literally have an "elastic" distributed worker mechanism where jobs are getting enqueued and more workers can be added/removed as needed depending on how many jobs are inactive.
15:26 jberger in theory yes
15:26 jberger but it doesn't do that automatically
15:27 Kogurr joined #mojo
15:27 vicash that i understand. i will have to write the worker startup/shutdown stuff but that is a huge design improvement for fault tolerance
15:38 jabberwok in looking at Beam::Wire i find mention of the CHI module (that's cache handler, not Chicago); and indeed there is Mojolicious::Plugin::CHI -- i'm wondering, since CHI's docs don't exactly say what it's good for:  Would that be a good way to share cached data between multiple instances of a Hypnotoad mojo program?
15:39 osfabibisi joined #mojo
15:39 jberger jabberwok: I'd suggest you learn a bit about CHI first
15:39 jberger its basically a common api for caching
15:40 jberger so answer to your question is ... it depends on the CHI backend you use
15:52 PopeF joined #mojo
16:09 absolut_todd joined #mojo
16:38 dvinci joined #mojo
17:12 neilhwat1on joined #mojo
17:52 patrickz joined #mojo
17:54 PryMar56 joined #mojo
17:57 bradjm joined #mojo
18:13 disputin joined #mojo
18:19 hernan604 joined #mojo
18:46 dod joined #mojo
20:11 disputin joined #mojo
20:23 disputin joined #mojo
20:30 dvinci joined #mojo
20:47 disputin joined #mojo
20:48 disputin joined #mojo
21:45 disputin joined #mojo
22:12 sri *crickets*
22:19 CandyAngel I didn't do it
22:19 * mikegrb sprays bugspray
22:20 Grinnz_ this is sadly sparse http://www.unixstickers.com/tag/perl
22:23 CandyAngel Sparse is such an understatement
22:29 jberger sri: are the documented defaults for heartbeat_timeout/interval for hypnotoad correct?
22:29 jberger I don't see hypnotoad changing the defaults from prefork but the documentation is different between the two; the code for prefork seems to confirm that prefork's documentation is correct
22:30 Grinnz_ "defaults to the value of "heartbeat_interval" in Mojo::Server::Prefork."
22:30 Grinnz_ that's an example, not a default
22:30 jberger doh!
22:30 jberger Grinnz_++ thanks
22:30 Grinnz_ I think having the defaults there would be less confusing though
22:31 Grinnz_ unlike other places that's not perl code, it's representing a config file
22:31 Grinnz_ i mean, it's not a function call or something
22:37 jberger I'm of two minds
22:37 jberger that really was just a brain fart
22:37 jberger but on quick look it appears to be a default
22:53 disputin joined #mojo
22:58 disputin joined #mojo
23:05 bradjm joined #mojo
23:44 bradjm_ joined #mojo

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