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

IRC log for #mojo, 2017-10-21

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

All times shown according to UTC.

Time Nick Message
00:59 itaipu joined #mojo
01:05 VVelox joined #mojo
01:50 esh joined #mojo
01:54 itaipu joined #mojo
02:06 zach joined #mojo
02:10 wouter joined #mojo
02:16 Zx3 joined #mojo
02:19 ddd joined #mojo
02:25 coolo joined #mojo
02:25 noganex_ joined #mojo
02:47 bbx joined #mojo
02:48 bbx IT IS THE L0DE RADIO HOUR AGAIN!!!
02:48 bbx 415-349-5666
02:48 purl -5600
02:48 bbx his live show @
02:48 bbx https://www.youtube.com/watch?v=rXWx3lPlwgE
02:48 bbx WE ARE TRYING TO INCREASE PARTICIPATION IN THIS SHOW
02:49 bbx PLEASE CALL AND PARTICIPATE.
02:49 bbx noganex_ coolo Zx3 wouter zach esh VVelox rba dantti_laptop dmanto jacoby ChmEarl perlpilot plicease hesperaux__ jamesaxl dboehmer_ Lee_ jnbek ghenry mtths stephan48 augensalat dustinm Sebbe ashimema S bobkare kaare Ralesk elik dotan_convos go|dfish nicomen chandwki hesco Andreas2 crab Bender
02:49 bbx vicash [0xAF] tempire cosimo mtj a6502 romel Jonis Armen trippeh eday michael sivoais_ mudler ranguard saki caeles_ jantore_ tardisx_ tyldis eseyman suede stein pink_mist spicyjack Peppard sjn alilles kamyl_ mattp_ Phil21 iamb firnsy_ matt klapperl_ mdom stryx`_ kivilahtio_ bc547_ jabberwok tianon
02:49 bbx left #mojo
03:16 klapperl joined #mojo
03:26 karjala joined #mojo
03:27 odc joined #mojo
04:04 dboehmer joined #mojo
04:21 foursixnine joined #mojo
04:31 mohawk i only have cpan-upload so cpan-<tab> does what i need it to (to push more of my badly-thought-out software towards the unsuspecting)
06:08 trone joined #mojo
07:07 dod joined #mojo
07:17 dod joined #mojo
07:36 karjala_ joined #mojo
07:52 Vandal joined #mojo
08:56 sh14 joined #mojo
09:10 cfedde joined #mojo
09:21 aborazmeh joined #mojo
09:35 rba_ joined #mojo
09:45 margeas joined #mojo
09:46 rba joined #mojo
09:57 rshadow joined #mojo
10:01 rba_ joined #mojo
10:13 itaipu joined #mojo
10:16 rba joined #mojo
10:32 rba_ joined #mojo
11:32 geheimnis` joined #mojo
12:03 kes joined #mojo
12:31 aborazmeh joined #mojo
13:22 ChmEarl joined #mojo
13:29 rba joined #mojo
13:32 rba__ joined #mojo
13:34 good_news_everyon joined #mojo
13:34 good_news_everyon [mojo] kraih tagged v7.48 at b70066c: https://git.io/vdbbf
13:34 good_news_everyon left #mojo
13:34 good_news_everyon joined #mojo
13:34 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vdbbJ
13:34 good_news_everyon mojo/master ad34eed Sebastian Riedel: bump version
13:34 good_news_everyon left #mojo
13:46 rba joined #mojo
14:02 rba_ joined #mojo
14:06 sri i wonder what the minion dashboard should look like
14:07 sri (3 weeks to hackweek, so i guess i should start planning the ui a bit)
14:16 rba joined #mojo
14:21 petru_ joined #mojo
14:31 rba_ joined #mojo
14:46 rba joined #mojo
14:47 jberger I'm no front-end designer so I can't help you there
14:48 jberger but if you want any of the code from https://github.com/jberger/Minion-Monitor/blob/master/lib/Minion/Monitor.pm please feel free
14:48 jberger if you want to do front-end testing, perhaps I'll have my Mojo::Chrome out by then
15:06 sri jberger: we talked about that before, i don't want a js app
15:30 jberger oh right, I forgot
15:30 jberger I do so much of it now my brain kinda starts there
15:36 rickbol joined #mojo
16:10 jberger mohawk: https://github.com/jberger/Mojo-Chrome/blob/master/t/basic.t
16:15 sri jberger: big problem is that they never age well, and i want the minion ui to be timeless
16:15 jberger oh I certainly understand
16:16 jberger though as long as it is just api backed people could add more reactive pages on top
16:17 sri why would they? which other job queue has ever done that?
16:18 sri i mean, kue kinda did, but that queue is not exactly in a good state
16:19 sri quite the opposite even, that ui never grew up and is rather shitty now
16:20 sri perl people won't do that if even node.js people wouldn't
16:22 sri celery, sidekiq, hangfire... on the other hand went plain html and it worked out great
16:23 sri visually this is still the one i like most https://www.hangfire.io/
16:24 jberger that does look nice
16:34 petru joined #mojo
16:38 good_news_everyon joined #mojo
16:38 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vdNfc
16:38 good_news_everyon mojo/master ae7db3f Sebastian Riedel: update jQuery to version 3.2.1
16:38 good_news_everyon left #mojo
16:47 mohawk jberger, looking
16:48 dod joined #mojo
16:48 mohawk wow, hangfire's page loads FAST
16:49 mohawk jberger, in that .t (we always call the first one "basic.t", amirite? :-) you might be more cautious in going: use_ok 'M::Chrome' || bailout?
16:53 Grinnz why bother?
16:55 mohawk ymmv
16:55 mohawk jberger, otherwise that's a beautiful, small testcase
17:08 montezuma joined #mojo
17:08 montezuma Hi
17:09 montezuma Is it possible to disable heartbeat_timeout on a per request basis
17:11 montezuma I'm getting  has no heartbeat, restarting (i.e. process being killed) for long running processes
17:13 montezuma Here are a few lines of my log:
17:13 montezuma [Sat Oct 21 17:47:13 2017] [debug] GET "/Download/file.zip" [Sat Oct 21 17:47:13 2017] [debug] Routing to controller "MyApp::Download" and action "Download" [Sat Oct 21 17:48:07 2017] [error] Worker 15336 has no heartbeat, restarting [Sat Oct 21 17:48:07 2017] [debug] Stopping worker 15336 gracefully [Sat Oct 21 17:48:22 2017] [debug] Stopping worker 15336 [S
17:13 montezuma let me try that again
17:13 montezuma [Sat Oct 21 17:47:13 2017] [debug] GET "/Download/file.zip"
17:13 montezuma [Sat Oct 21 17:47:13 2017] [debug] Routing to controller "MyApp::Download" and action "Download"
17:13 sri STOP
17:14 sri please don't paste into the channel
17:14 montezuma ok
17:14 sri it's considered very rude
17:14 sri and no, you can't
17:15 montezuma Sorry, I did check the CODE-OF-CONDUCT, did not see that I could not
17:15 sri it's general irc etiquette
17:15 sri many channels ban you right away
17:20 montezuma Anyone know how I can run a slow long running process (e.g. a large download that is generated on the fly ) without it being killed
17:22 montezuma the inactivity_timeout (per process is what I thought would take take of this) but it does not
17:23 Grinnz montezuma: subprocesses are one way
17:23 montezuma I tried that, but the storage is a problem
17:24 Grinnz you can increase heartbeat timeout but that's only papering over the issue that you're blocking a worker for a long time
17:25 montezuma Why does inactivity_timeout not solve this problem?
17:25 Grinnz because it's not inactive
17:26 Grinnz it's unable to respond to the heartbeat because it's blocked
17:26 sh14 joined #mojo
17:26 Grinnz inactivity timeout is a timeout on the connection to a certain client if that connection is inactive
17:27 montezuma I see
17:27 Grinnz such as if it's waiting on a subprocess for a long time, or some other async operation, before it renders a response
17:27 Grinnz also relevant to websockets
17:28 montezuma If I generate the data I need in a subprocess and say store it in a file, how can I get that data base to the original GET request?
17:29 Grinnz you can return a Mojo::File::Asset or the filename itself from the subprocess
17:30 Grinnz er Mojo::Asset::File
17:30 Grinnz you could use Mojo::Asset::File to automatically store it in a temp file, return that, then serve it directly
17:33 montezuma is it ok to post a URL to mojo website here?
17:34 montezuma I assume not
17:37 montezuma thanks Grinnz I will try that
18:18 CandyAngel Can I manipulate ->remaining in Mojo::IOLoop::Delay if I want to add steps?
18:19 sri yes
18:19 CandyAngel Exxxcellent *taps fingertips together*
18:19 CandyAngel Thankies ^_^
18:30 * sri vaguely remembers jberger reacting the same way when i answered that question for him
18:32 * mohawk checks surreptitiously to see if Future can do that
18:33 pink_mist mohawk: that's just a ->then in Future
18:34 mohawk oh of course, to add steps
18:34 mohawk i was also immediately thinking of being able to remove steps too
18:36 mohawk i guess you'd do ->pending (on the convergent future) then ->cancel as appropriate
18:42 * sri really doesn't like it when people start using delays like promises and pass them around
18:42 mohawk sri, may i ask why so?
18:44 sri because they were never designed for it and there is no api for composing delays
18:44 sri it's just shitty design
18:45 sri what do you do when you have two apis returning delays?
18:45 sri it's just garbage for that
18:45 mohawk if delays can't be used composition-stylee, then fair enough
18:45 sri delays are for continuation passing style
18:46 sri i've thought about replacing delays with promises in mojo a few times, but nobody ever could come up with a good api
18:47 sri continuation passing style is just superior imo
18:47 mohawk i guess it would need to be back-compat?
18:48 sri not necessarily, we can release big breaking changes as 8.0
18:48 mohawk fair
18:48 mohawk i've been thinking a lot about async programming styles, as you may have gathered
18:49 mohawk so that i can be sure i understand you as well as i'm going to - continuation-passing style = what i'd expect to make threads work?
18:49 sri things get awkward with mixed apis like $ua->get('...') and $ua->get('...' => sub {...})
18:50 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Blocking-and-non-blocking-operations
18:51 sri has nothing to do with threads
18:51 mohawk i am aware
18:51 sri then we have $ioloop->timer(5 => sub {...}) vs $ioloop->recurring(5 => sub {...})
18:52 sri only one can be replaced with a promise returning method
18:52 mohawk what i'm asking is, the general concept of "continuations" (and passing them) is what a thread-dispatcher would do?
18:52 sri not something i think very much about
18:55 sri kinda irrelevant for perl 5
19:04 mohawk i'm going to proceed on the basis that we are talking about the same thing, on that point :-)
19:04 mohawk and i assume from your thought above that you mean "recurring" is a continuation, while "timer" is a promise?
19:07 Grinnz recurring can't be represented by a future/promise, since that only completes once
19:11 mohawk indeed
19:12 Grinnz then again, that's not currently using delays either, so theres not really a need to turn that into a future api
19:14 mohawk quite
19:16 sri true
19:16 sri but the inconsistency would still look weird
19:17 mohawk recurring could just be implemented as a self-re-scheduling promise
19:17 sri naah, it would be a perl6-ish supply if the api got ever changed
19:17 mohawk if the top-level delay-looky-up thing were a convergent promise, that seems like it would work
19:18 mohawk ok
19:19 sri and a supply is basically an observable
19:19 sri in fact, i'd prolly name it Mojo::Observable
19:20 mohawk is there any conceptual difference between observables and pub/sub?
19:20 sri not in my mind
19:20 mohawk cor, i understood a thing
19:21 * mohawk fetches his drill to put up a plaque
19:23 sri maybe Mojo::IOLoop::delay was a mistake, it kind of pushes the concept on people
19:23 sri a utility module might have been better
19:24 mohawk it's kind of a (very utile) utility method anyway?
19:25 sri use Mojo::IOLoop::Util 'delay'; delay(sub {...}, sub {...}, ...);
19:26 sri that would have been better i think
19:26 mohawk yes
19:27 sri perhaps even under the original name step()
19:27 sri derived from the inspiration step.js
19:28 mohawk my little brain feels a bit resistant to that name
19:31 sri hmm, i might actually deprecate Mojo::IOLoop::delay
19:32 sri it should feel like a utility, not a core concept
19:33 sri and i would assume most folks use the delay helper instead anyway
19:33 sri (in end user code)
19:33 mohawk that seems reasonable
19:33 sri http://mojolicious.org/perldoc/Mojolicious/Plugin/DefaultHelpers#delay
19:35 sri oh, btw. there is one more special case, Mojo::EventEmitter
19:35 sri ->on(foo => sub {...})
19:35 purl ->on(foo => sub {...}) is very DSLish
19:36 sri heh
19:36 mohawk ha ha, nice
19:36 mohawk well that's observable/pubsub right there
19:36 sri yea
19:36 mohawk so, one can slightly reduce one's "models" footprint :-)
19:36 sri my $observable = $foo->on('bar');
19:37 sri eventemitter are used very very heavily though, so that's a tough one to change
19:37 sri if one were to attempt it
19:38 mohawk one might (little finger by mouth)... defer... such an attempt for the present time
19:39 mib_nx4m27 joined #mojo
19:40 CandyAngel Okay, I don't even need to add more steps, I can do the batch request thing and just add it to the queue..
19:42 mib_nx4m27 Hi, I'm running Mojolicious (6.57, Clinking Beer Mugs) and when using Mojo::IOLoop::Subprocess, I get the following error: Magic number checking on storable string failed at /usr/lib64/perl5/Storable.pm line 417, at /usr/local/share/perl5/Mojo/IOLoop/Subprocess.pm line 44.
19:43 mib_nx4m27 is this a known error? - btw: I am not in s position to upgrade to a newer version
19:43 mib_nx4m27 Sorry known bug
19:44 mohawk cor, 6.57 = one major version behind current?
19:44 Grinnz um, Mojo::IOLoop::Subprocess didn't exist in that version
19:46 mib_nx4m27 Well, I used "mojo version" to get the version
19:46 sri jberger, marcus, batman: how do you feel about deprecating Mojo::IOLoop->delay and adding a Mojo::Util::delay instead?
19:46 mohawk sri, what would that give that the default helper wouldn't?
19:47 sri helpers are only available for apps
19:47 sri umm web apps
19:47 purl web apps are by nature largely event-driven
19:47 mohawk ahh, gotcha
19:47 mohawk i forgot about the client side, thanks :-)
19:47 sri delays are flow control for all contexts
19:48 mohawk actually, client-ish could be M::UA which is still event-ish. what other contexts are there?
19:48 sri any module using Mojo::IOLoop
19:48 sri Mojo::Pg, Mojo::Redis...
19:48 mohawk gotcha, thanks
19:49 pink_mist mib_nx4m27: and the version of mojo you have installed didn't come with that module, so you must have gotten that module from some other version. upgrade completely instead.
19:52 mib_nx4m27 I think you are correct
19:52 sri hmm, i guess the real question is if i want it to be "use Mojo::Util 'delay';" or "use Mojo::IOLoop::Delay 'delay';"
19:53 mohawk if it's an exported function is there a stylistic objection to exporting it from a class ie Mojo::IOLoop::Delay?
19:54 sri you mean just exporting it from a class or exporting it implicitly with "use Mojo::IOLoop::Delay"?
19:54 mohawk sorry, to be clearer:
19:54 mohawk i thought  Mojo::IOLoop::Delay was a class
19:54 sri oh, purity wise you mean
19:54 mohawk and i was thinking that classes that also export functions might be a bit less stylish?
19:55 mohawk sure, only purity-wise
19:55 sri i don't mind it for alternative constructors
19:55 sri we have "use Mojo::ByteStream 'b';"
19:55 mohawk fair
19:56 sri i used the concept heavily in Mango::BSON
19:56 sri worked great there
19:56 sri https://metacpan.org/pod/Mango::BSON#SYNOPSIS
19:56 mohawk feels a bit JS-y to me (which is not an objection)
19:56 sri since there were so many data types that needed wrapper objects
19:57 * mohawk takes a look
19:57 mib_nx4m27 If I remember, I added that to my local machine cos I could not upgrade the SSL at the time, but got   Mojolicious (7.07, Doughnut) so will try on that machine
19:57 sri would be a nightmare to type the whole class for every value in the data structure :)
19:58 mohawk quite!
19:58 sri Mango::BSON::Document->new(foo => Mango::BSON::Boolean->new(1), bar => Mango::BSON::Binary->new($bytes), ...)
19:59 mohawk ha ha
19:59 sri that's what made me embrace constructor functions for heavily used objects
20:00 sri (not that i overuse the concept)
20:00 sri woth having in the toolbox... purity is overrated
20:03 mohawk to me - like many things, purity is supposed to be a servant, not a master :-)
21:21 gordonfish joined #mojo
22:19 sri hmm
22:19 sri it's odd, i don't really like the look of a delay function
22:20 sri https://gist.github.com/anonymous/78a45dfa6b13f262f94eee17350d7698
22:20 sri second version looks weird to me
22:21 sri maybe i'm just used to seeing the first version?
22:21 * sri shrugs
22:25 * jberger reads back
22:30 rshadow joined #mojo
22:32 * sri wonders if it would be weird to just make delays composable
22:33 sri they could actually be then-ables
22:33 sri lol
22:35 sri hmm, that doesn't even seem that crazy
22:35 sri usually the big problem with promises is that it sucks to wrap apis in them
22:36 sri delays make that rather pleasant
22:36 sri and delays have fail/success conditions
22:36 sri i mean, people already want to use them as psomises
22:37 sri s/s/r/
22:37 sri hmm
22:38 sri now i'm really curious if delays could be molded into https://promisesaplus.com
22:39 mohawk sri, that gist you could make the sub { ... } be an array, to de-dup :-)
22:40 mohawk or rather, to DRY
22:43 sri jberger: in case you're wondering, my problem is that i hate seeing people use delays like they were composable like promises
22:44 sri interesting thing is delays are kinda like promises internally, all the low level infrastructure exists
22:44 sri http://mojolicious.org/perldoc/Mojo/IOLoop/Delay#EVENTS
22:45 sri those two events kinda represent fulfilled and rejected
22:45 sri and since they are pub/sub events, you could attach multiple chained promises to that
22:46 sri a ->then method would be very little code
22:47 sri rejected would need a new method too though i guess, so it can propagate through the promise chain
22:48 sri hmm
22:50 sri yea, ->reject ->resolve and ->then would need to be added
22:50 sri oh, wow, it's actually fairly easy
22:51 sri both already exist internally
22:51 mohawk sri, do i understand right that delays are about to become very promise-y indeed?
22:52 sri i'm just experimenting
22:52 sri but it's possible
22:52 sri (++$self->{fail} and return $self->remaining([])->emit(error => $@));
22:52 sri that seems to be fairly clean ->reject behavior
22:52 mohawk if so, is it a crazy idea to just use an existing promise module?
22:52 mohawk especially Future?
22:52 sri i hate Future
22:52 sri would never use it, sorry
22:52 mohawk fair enough
22:53 mohawk Promises then?
22:53 sri wasn't that mostly abandonware by now?
22:53 mohawk possibly
22:53 mohawk what's the problem you see with Future?
22:53 mohawk (as a not-yet-user i'm very interested :-)
22:54 sri anyway, delays would be quirky mojo style promises
22:54 sri i'm not going to break existing code
22:54 sri and, i think there is value in pushing generic then-ables in the community
22:54 mohawk i agree
22:54 mohawk i just weep a little inside at there being yet another WTDI ;-)
22:55 sri my main problem with Future is that it's incompatible with promises/a+
22:55 sri last i looked it even checked if promises passed to it were ->isa('Future') or so
22:55 sri it doesn't want to work with others
22:57 sri mohawk: if there was a well established module i'd use it, like how we added Role::Tiny support recently
22:58 mohawk hm
22:58 mohawk i have a feeling the leonerd would at least be receptive to making Future be more compatible
22:58 mohawk the -> that, doh
22:59 sri i've talked to leonerd a few times about it already
22:59 sri there's some internals that depend on it and he doesn't want to change
23:00 sri i think it's one of those things that we could change by making more popular promise modules
23:00 sri like how we made all the event loops compatible
23:00 mohawk this would be one of those things where i would really, really like this proposed new thing to be not part of the Mojolicious borg :-)
23:00 sri well, i'm not making a Mojo::Promise module
23:01 sri only adjust an already existing object to be a then-able too by adding like 10 lines of code :p
23:14 mohawk that's fair enough
23:15 mohawk it does sound as though i want to be able to use it outside of the borg though :-)
23:42 Ralesk joined #mojo
23:55 cng joined #mojo
23:59 Ralesk joined #mojo

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