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

IRC log for #mojo, 2015-07-22

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

All times shown according to UTC.

Time Nick Message
00:47 dvinciguerra joined #mojo
01:00 jontaylor joined #mojo
01:08 jontaylor_ joined #mojo
01:12 mattastrophe joined #mojo
01:48 cpan_mojo Mojolicious-Plugin-Log-Elasticsearch-1.152030 by JUSTIN https://metacpan.org/release/JUSTIN/Mojolicious-Plugin-Log-Elasticsearch-1.152030
02:03 noganex joined #mojo
02:16 mattastrophe joined #mojo
02:30 esh joined #mojo
02:31 jontaylor joined #mojo
02:49 kaare joined #mojo
03:08 esh joined #mojo
03:12 absolut_todd joined #mojo
03:16 cpan_mojo Mojolicious-Plugin-Log-Elasticsearch-1.152031 by JUSTIN https://metacpan.org/release/JUSTIN/Mojolicious-Plugin-Log-Elasticsearch-1.152031
03:28 cpan_mojo MojoX-Mysql-0.16 by KOSTYA https://metacpan.org/release/KOSTYA/MojoX-Mysql-0.16
03:37 jberger pink_mist: oh you're right, thowe did ask a slightly similar question but then it was Dave who had the routing question
03:37 jberger The generated avatars in my client look similar (that's my excuse)
04:01 disputin joined #mojo
04:28 dotandimet joined #mojo
04:43 arpadszasz joined #mojo
04:44 melo1 joined #mojo
04:54 zivester joined #mojo
05:30 dotandimet joined #mojo
06:01 hshong joined #mojo
06:45 dod joined #mojo
06:50 dod joined #mojo
07:19 eseyman joined #mojo
07:21 AndrewIsh joined #mojo
07:25 berov joined #mojo
07:32 dp_ joined #mojo
07:33 Vandal joined #mojo
07:47 kaare_ joined #mojo
07:48 oetiker_ joined #mojo
07:51 oetiker joined #mojo
08:18 berov1 joined #mojo
08:31 jontaylor joined #mojo
08:35 dod joined #mojo
08:37 trone joined #mojo
08:40 inokenty joined #mojo
08:40 ans joined #mojo
08:52 mattastrophe joined #mojo
08:52 esh joined #mojo
08:53 ladnaV joined #mojo
09:23 batman jberger: Thanks :)
09:34 jontaylor Would anyone be interested in a New Relic like service for Perl, including a plugin for Mojolicious ?
09:35 jontaylor Just trying to work out if enough people could get benefit to make it worth bothering with, over just doing something like nginx log monitoring
09:36 cpan_mojo MojoX-Tree-0.05 by KOSTYA https://metacpan.org/release/KOSTYA/MojoX-Tree-0.05
09:56 pink_mist thowe: you got linked some slides earlier ... here's the talk they're for: https://www.youtube.com/watch?v=YYVFaHkASZY :P
09:58 dvinciguerra joined #mojo
10:23 mattastrophe joined #mojo
10:38 mattastrophe joined #mojo
10:51 jontaylor I’m struggling trying to work out how to do high availability scheduled jobs with Minion
10:52 jontaylor I could have two machines, both inserting jobs to the queue from a cron job, but then i’d get the task run twice
10:53 jontaylor I could have both cron jobs be a little smarter and try to query the DB to see if the job has already been inserted, but that feels like it could leave me open to a race condition without some kind of locking
10:56 jontaylor then I start thinking about moving the problem backwards a bit, and only running the cron on one machine, but then the second machine needs to be aware of when the first fails, and then start its own cron, without missing any queue insertions
11:04 jontaylor bah, then I find this https://github.com/kraih/minion/issues/7
11:04 jontaylor a lock parameter would have been handy for this use case
11:15 neilhwatson joined #mojo
11:56 Mikey so you want to submit two jobs and have only one of those two jobs run?  if you submit two jobs.. two jobs will run.  that makes sense to me.
11:59 Mikey is there a way to derive some kind of unique id from the input parameters?  you might be able to hash all the inputs together to get something unique enough to check if it exists.. maybe do a quick insert in your task into a db with a unique constraint on whatever column you store the id into.. and whichever one gets the insert does the job, whichever one doesn't, doesn't?
12:00 Mikey i add minion tasks from horizontally scaled web app servers though not from cron.. if i was running something from cron i'd just run a mojo command or something
12:06 adnane joined #mojo
12:08 arpadszasz joined #mojo
12:23 esh joined #mojo
12:24 jberger So who is the talk author? Is he here?
12:25 jberger pink_mist: ^^
12:33 Averna joined #mojo
12:37 hernan605 joined #mojo
12:42 jontaylor Mikey: i’ve ended up doing exactly that :p
12:44 Averna joined #mojo
12:54 esh joined #mojo
13:06 Mikey jontaylor: heyyyy awesome :D
13:07 Mikey does PREEMPT_RT have any effect on IOLoop/libev?
13:08 Mikey i just googled this.. and found http://irclog.perlgeek.de/mojo/2015-02-09 that i have already asked this question.
13:09 Mikey and said that i would figure it out and report back.  i am such a let down.
13:13 jberger Mikey: hahahaha
13:13 purl LOLCON 4 reached.
13:14 dvinciguerra joined #mojo
13:15 arpadszasz joined #mojo
13:16 Grinnz rofl
13:28 gryphon joined #mojo
13:41 hernan605 joined #mojo
13:50 bc547 joined #mojo
13:56 zivester joined #mojo
14:06 pink_mist jberger: I don't know :P tempire should know .. he's in the audience :P
14:09 stuart joined #mojo
14:25 mattastrophe joined #mojo
14:32 jberger good call
14:33 jberger tempire: waz happennenn
14:33 jberger I only have one difference of opinion with that talk
14:33 stu joined #mojo
14:33 jberger in the last portion, the structure of the helpers is such that it returns steps
14:34 jberger I think its much more reusable to take a callback than to return a step
14:34 jberger the flow control belong to the place its being used
14:34 jberger and the asynchronous function is reusable elsewhere
14:34 jberger seems like the natural boundary to me
14:43 Grinnz_ what ive been doing lately is "take callback, return delay object"
14:49 jberger that's just to return something though right?
14:49 jberger the delay still invokes the callback when it finishes
14:50 Grinnz_ it's mainly so i can add a catch to the delay, in the outer context
14:50 jberger I usually call $delay->wait at the end of these things so that I can make sure that they work portably
14:50 jberger Grinnz_: why not just have a catch inside the method?
14:50 Grinnz_ the method doesn't have the outer context
14:51 jberger it doesn't need it, the callback can take an exception
14:51 * Grinnz_ shrugs
14:51 jberger Mojo::IOLoop->delay(...)->catch(sub { $cb->($_[1]) })->wait;
14:51 jberger ^^ how almost all of my non-blocking methods look
14:52 Grinnz_ the outer context can also call wait if it needs
14:52 Grinnz_ (i havent so far, in these instances)
14:52 jberger but what if you call them from say the eval command?
14:52 Grinnz_ eval command?
14:53 jberger ./myapp eval 'app->nb_helper(arg => sub { print app->dumper(@_) })'
14:53 Grinnz_ these aren't helpers
14:54 jberger why not?
14:54 Grinnz_ because it doesn't look right to stick code for specific functionality into my generic startup routine
14:55 Grinnz_ (and i'd have like 300 helper methods for that if i did)
14:55 Grinnz_ i could make them all plugins, maybe
14:56 Grinnz_ but.. meh
14:56 Grinnz_ these functions just dont really have any need for the controller or app
14:56 Grinnz_ the catch that i append to them just says what to do when they die
14:57 esh joined #mojo
14:57 jberger https://github.com/jberger/MojoForum/blob/master/lib/MojoForum/Helpers.pm
14:57 jberger that was my demo app for mojoconf
14:58 stu what
14:59 kaare joined #mojo
15:04 jberger Grinnz_: I'm not saying you are wrong btw, its just a different pattern
15:05 kaare_ joined #mojo
15:09 lluad joined #mojo
15:11 disputin joined #mojo
15:26 dod joined #mojo
15:30 dod1 joined #mojo
15:31 Kogurr joined #mojo
15:33 stu I need to get real-time-like performance while interfacing a highly blocking API
15:34 stu I make a call to ask for events, if there are some, those are returned
15:34 stu if they're are none, it keeps me waiting till either some events come in, or we timeout
15:34 stu They're imagining I'm have a C# fat client
15:35 stu and they recommend I assign one thread per user for this one task
15:35 stu But I have non-threaded perl
15:35 stu and the rest of my app is highly responsive
15:36 Grinnz_ stu: Mojo::IOLoop::ForkCall
15:36 purl hmmm... Mojo::IOLoop::ForkCall is jberger's module for that
15:36 stu I don't know if I should be thinking about an additional hypnotoad worker per user, or setting something up with minion
15:36 Grinnz_ ah, are you talking like a websocket interface?
15:37 stu no, I'd love it if they offered websockets
15:37 stu but they've have explicitly geared this for people who can't handle websockets
15:37 stu Isn't
15:37 stu Isnt' ForkCall aimed at ad hoc workers rather than known-in-advance requirements?
15:38 Grinnz_ and i don't suppose there's any way you can get a non-blocking "are there events ready" call ;)
15:38 jberger stu: ::ForkCall presents a non-blocking interface to forking
15:38 amon joined #mojo
15:38 jberger what do you mean "known-in-advance requirements"
15:38 Grinnz_ yes, if you want "in advance" then hypnotoad workers are more along those lines... but you really don't want to block up workers
15:38 Grinnz_ also you can't guarantee which worker will accept which request...
15:39 Grinnz_ unless you set max_accept or whatever to 1
15:39 stu I'm thinking however I do it, there's no escaping having one worker per user permanently blocking
15:39 jberger oh wait
15:39 jberger this is the same type of api I had for FriendFeed
15:39 stu ahh, yeah, these blocking workers would need to be configured completely differently to the real app workers
15:40 Grinnz_ indeed
15:40 Grinnz_ you'd need huge heartbeat timeouts
15:40 jberger https://metacpan.org/source/JBERGER/Mojo-FriendFeed-0.05/lib/Mojo/FriendFeed.pm#L57
15:40 * stu looks at FriendFeed
15:40 Grinnz_ that's still a non-blocking request :P
15:41 jberger yes, but the pattern would work with a ForkCall rather than a UA
15:41 jberger I'm talking patterns here
15:41 Grinnz_ true
15:42 jberger stu: how do you make this call to the external system?
15:42 Grinnz_ stu: anyway there's no reason you can't just ForkCall on demand too.. if it's blocking "forever" then there's no huge performance difference anyway
15:42 jberger C function, perl function, web request?
15:43 stu jberger: get over https
15:44 jberger then its exactly like FriendFeed
15:44 jberger no forks needed
15:44 jberger just non-blocking ua
15:44 jberger you'll have to modify it to handle the timeout to rerequest
15:44 charsbar joined #mojo
15:45 jberger but the pattern is basically the same
15:45 jberger friendfeed would wait to respond at events as you describe
15:45 stu jberger: what would you use to host that code?
15:46 jberger ?
15:46 jberger its part of your app
15:46 jberger I don't know what you mean
15:46 jberger that was part of an IRC bot
15:46 jberger but it could have as easily been a webpage relay
15:46 kyshtynbai joined #mojo
15:47 jberger rendering new friendfeed events to the client via say websocket
15:47 Grinnz_ stu: yeah if you're doing this over HTTP, then you don't actually have a blocking API, you're just using a blocking useragent ;)
15:47 jberger Grinnz_: not even a blocking UA, non-blocking is fine
15:47 Grinnz_ i mean, currently
15:47 Grinnz_ 11:33:49           <stu> I need to get real-time-like performance while interfacing a highly blocking API
15:47 stu Can I have 100 blocking UAs without hampering the rest of the app?
15:48 Grinnz_ use a non-blocking UA
15:48 jberger stu: no, you need non-blocking
15:48 Grinnz_ which Mojo::UserAgent is
15:48 jberger what Grinnz_ said
15:48 jberger :-)
15:48 stu when you say that, do you mean a UA calling with a call-back?
15:48 hernan605 joined #mojo
15:48 jberger Grinnz_: he meant that the external service is long-request
15:48 Grinnz_ stu: yes.
15:49 stu ok, I think I'm understanding you now
15:49 stu thanks
15:49 jberger (I assume "he" with a name like "stu", sorry if I'm wrong)
15:49 Grinnz_ when your external API is directly over HTTP, everything is "simple" :)
15:49 Grinnz_ https://metacpan.org/pod/Mojolicious::Guides::Cookbook#Non-blocking
15:49 stu jberger: yeah, some folks confuse me with my sister Stfu
15:50 disputin joined #mojo
15:50 jberger :P
15:50 jberger I just always want to be inclusive
15:50 stu thanks guys
15:50 Grinnz_ also see https://metacpan.org/pod/Mojolicious::Guides::Cookbook#Backend-web-services for using it in an app
15:54 trone_ joined #mojo
15:55 disputin joined #mojo
16:04 jberger stu: this was how I used the FriendFeed module in the irc bot, btw
16:04 jberger https://metacpan.org/source/JBERGER/Mojo-FriendFeed-0.05/ex/cpan.pl
16:07 PryMar56 joined #mojo
16:11 esh joined #mojo
16:24 stu ta
16:44 esh joined #mojo
16:47 sh4 joined #mojo
16:57 dod joined #mojo
16:59 marcusr paul fenwick on stage at oscon.
17:11 berov joined #mojo
17:20 esh joined #mojo
17:28 dotandimet joined #mojo
17:33 arpadszasz joined #mojo
17:47 marty_ joined #mojo
17:50 mattastrophe joined #mojo
17:54 marty joined #mojo
18:05 disputin joined #mojo
18:14 jontaylor joined #mojo
19:26 mudler joined #mojo
19:29 tempire What do I know?
19:29 tempire jberger: pink_mist ^
19:34 jberger oh, that is pink_mist?!
19:35 jberger tempire: the question was, the author of that SLC.pm Mojo async talk, is the author on irc?
19:35 jberger if so, what nick?
19:35 jberger you are on the video sitting right there
19:35 tempire url?
19:36 jberger https://www.youtube.com/watch?v=YYVFaHkASZY
19:36 tempire Oh, Scott
19:36 tempire He's rarely on IRC
19:37 jberger I don't agree with the final recommendation (the helpers that return steps thing) but I do think the rest is a pretty good talk
19:37 tempire What's the time mark?
19:38 jberger for what?
19:38 purl for fun.
19:38 * jberger pats purl
19:38 * purl bites!
19:38 tempire where his final recommendation is
19:39 tempire Oh I see what you're saying
19:40 jberger https://youtu.be/YYVFaHkASZY?t=3232
19:40 jberger I was just going to discuss it a bit with him if he was on here
19:40 tempire Scott and I actually came to a lot of these conclusions together
19:40 jberger Grinnz_ was advocating returning the delay object itself
19:41 tempire We worked together for about 1 1/2 years
19:41 tempire So I'm in agreement with him
19:41 jberger I have usually advocated a much more self-contained non-blocking helper style
19:41 cpan_mojo Business-Payment-SwissESR-0.10.0 by OETIKER https://metacpan.org/release/OETIKER/Business-Payment-SwissESR-0.10.0
19:41 jberger returning callbacks to use as steps
19:41 jberger ?
19:41 jberger seems icky
19:41 tempire Why does it seem icky?
19:41 tempire It's a higher order function
19:42 tempire hides stuff you don't care about
19:42 tempire get the geolocation
19:42 tempire get weather
19:42 tempire move on
19:42 tempire The only thing I'd go farther in is making a "step maker" like he said
19:42 tempire Which we actually did
19:42 tempire We called them units
19:42 jberger because it makes assumptions about the environment that it is going to be run in
19:43 tempire Well yeah. That's inevitable.
19:43 tempire Particularly if it's your application.
19:43 tempire Each unit had a specific format that knew how to handle results and errors and such
19:43 jberger if you isolate the behaviors they become more composable
19:43 jberger like regular functions
19:43 jberger https://github.com/jberger/MojoForum/blob/master/lib/MojoForum/Helpers.pm
19:44 jberger notice that some of the later ones use the earlier ones
19:44 tempire This is a step behind where your Helpers.pm goes
19:44 tempire Particularly if they all fit a particular pattern
19:45 jberger I don't know what you mean by behind
19:45 tempire Which he only touched upon in his last sentence, he didn't really show
19:46 tempire Let me start again
19:46 tempire I don't disagree with you.
19:46 tempire Neither would Scott, he just stopped short of composable because of the time of the talk.
19:46 jberger ah
19:47 jberger that's a different thing then
19:53 jzawodn joined #mojo
20:03 mattastrophe joined #mojo
20:08 Eke- joined #mojo
20:08 jzawodn joined #mojo
20:11 Eke joined #mojo
20:26 marcusr jberger, tempire. I'm in your country, eating all your cookies.
20:26 tempire NOOOOOOOOOO
20:26 purl ┻━┻︵ (°□°)/ ︵ ┻━┻
20:27 tempire Where abouts?
20:27 marcusr portlandia
20:27 purl portlandia is very quiet.
20:27 tempire Portland is the worst
20:27 tempire Unless you like coffee shops
20:27 marcusr I guess I do.
20:27 tempire Still planning on relocating?
20:27 marcusr seems like it's pretty decent for beer too.
20:27 marcusr No.
20:27 marcusr Not since Nordaaker cratered.
20:28 tempire Ah right
20:28 marcusr I'm currently enjoying my life in academia.
20:28 tempire Well
20:28 tempire There's plenty of dancing in Portland
20:28 tempire So let me know if you want to cut a rug while you're there
20:28 marcusr how sinful.
20:28 marcusr :)_
20:37 marcusr obra is here with his new keyboard. It looks really nice.
20:54 hernan605 joined #mojo
21:00 hernan605 joined #mojo
21:12 trone joined #mojo
21:19 cpan_mojo Business-Payment-SwissESR-0.11.0 by OETIKER https://metacpan.org/release/OETIKER/Business-Payment-SwissESR-0.11.0
21:21 disputin joined #mojo
21:22 neilhwatson joined #mojo
21:38 disputin joined #mojo
22:07 batman jberger: i agree on using callbacks. Never had much luck passing $delay around.
22:08 batman I do it occasionally, but end up with a mess.
22:08 Grinnz_ whatever works, just be consistent
22:08 batman It would be impossible to use $delay and be consistent, since "everything" else use callbacks
22:08 Grinnz_ i'm not following; it still uses a callback
22:09 Grinnz_ at least, what i was talking about
22:09 batman I think I have missed out on something.
22:09 * batman backs off
22:09 batman :)
22:09 Grinnz_ i dont know exactly what jberger was saying was being presented
22:10 batman apple-- # messed up the delivery address :(
22:10 batman I don't have a computer before Monday.
22:10 Grinnz_ verizon sent my last phone to the neighbors across the street, eventually the neighbors figured it out and brought it over :P
22:10 batman Grinnz_: Haha
22:11 Grinnz_ this is why i dislike giving people my address over the phone... too easy to mess up
22:12 batman It's rather strict here. I need to show up myself with ID papers to get the package
22:13 Grinnz_ if they have it at the service center, yeah you need an ID
22:13 Grinnz_ but americans are lazy, so they let you designate somewhere to leave it if you're not home, and usually leave it even if they're not supposed to
22:14 batman :/
22:14 batman That's no good.
22:15 Grinnz_ yeah, its a bit frustrating
22:15 batman "Well... Somebody signed!"
22:16 Grinnz_ oh man, leaving it when a signature is required, thats the best/worst
22:16 batman Still going to see if my gf can get it out for me, hehe
22:38 mattastrophe joined #mojo
22:41 disputin joined #mojo
23:08 disputin joined #mojo
23:33 mattastrophe joined #mojo
23:43 Grinnz joined #mojo
23:45 disputin joined #mojo
23:57 Dave If I'm using "extends" in a template with a variant value in the stash, shouldn't the extends target be variant-ed too?

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