Camelia, the Perl 6 bug

IRC log for #mojo, 2013-08-20

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

All times shown according to UTC.

Time Nick Message
00:00 sri why the hell does the travis bot announce random mojo forks :o
00:00 buu sri: Ok, right, that was my initial understanding. Where do I go from there?
00:01 sri buu: to the cookbook
00:01 buu Are you trying to refer to a non-blocking request?
00:01 sri http://mojolicio.us/perldoc/Mojoliciou​s/Guides/Cookbook#Backend_web_services
00:02 sri btw. minimal test cases are a lot smaller if you make lite apps
00:02 sri that's what we made lite apps originally for
00:02 buu I tried to make a Lite app but my 2 minutes of messing around couldn't get Test::Mojo to launch it properly =/
00:03 sri you could have looked at any of the 100 or so test files in the mojolicious repo
00:05 buu Oh. Huh.
00:05 go|dfish joined #mojo
00:05 buu That's cool.
00:06 sri https://github.com/kraih/mojo/blob/ma​ster/t/mojolicious/charset_lite_app.t
00:06 buu Yeah that's one of the ones I just looked at!
00:06 sri :)
00:06 buu But anyways, back to my original problem. You sent me this cookbook link which suggests a non-blocking request right?
00:07 sri right
00:07 buu I'll try to reproduce it in a second, but when I tried that in my main app the 'test app' was closing down before the non-blocking request actually hit it
00:08 sri ok, i'll tell you what i told tempire a few times during the last few weeks
00:08 sri buu: SCOPE!!!1
00:08 sri :)
00:08 sri looking at your test case, i'm almost certain you made the same mistake
00:11 Kundun joined #mojo
00:12 buu sri: Are you saying I need to keep the $ua I use in side the handler alive?
00:12 sri of course
00:12 buu With the callback change I get "Premature connection close at lib/Test/Example.pm line 9."
00:12 sri where else could it be stored?
00:13 buu Oh
00:13 buu I kind of assumed it would be part of the magical global event loop!
00:13 buu Too much POE I guess!
00:14 sri ok, POE is a bit quirky ;p
00:15 buu Ok, quick and dirty I changed it to this: http://scsys.co.uk:8002/266040
00:15 buu I run it with MOJO_USERAGENT_DEBUG and the debug output  looks correct
00:15 buu but I never see my 'CALLBACK' error!
00:15 sri see cookbook
00:16 sri you need to do *everything* non-blocking
00:16 buu sri: Sorry, by everything do you mean the stuff inside the handler or the stuff inside the .t script?
00:17 sri you can't render before the request is finished
00:17 buu Um. I'm not actually trying to render anything from the callback, but do you mean the handler finishing/rendering is somehow messing up my callback?
00:18 sri not sure i'm following anymore
00:18 buu ACtually how the hell is this not infinite looping now that I think about it
00:18 buu sri: I just want my handler to launch a http request that 'fires and forgets', it triggers an action elsewhere, but I don't care about the return value
00:18 sri that won't work in tests
00:19 sri Test::Mojo starts and stops the event loop when it's waiting for stuff
00:19 sri you'd have to start it again manually afterwards
00:19 buu Well, bugger.
00:20 sri i don't see how it could work any other way
00:20 buu I don't suppose you could suggest a sane route forward for testing this type of application?
00:20 buu The only thing that occurs is to just launch a morbo/hypnotoad/whatever instance and then test against that?
00:21 sri i don't do stuff like that
00:21 sri job queue for anything that can be delayed
00:21 buu Well essentially this is a job queue, its just queuing events via http requests
00:21 buu Now that I think about it
00:21 sri this async fire and forget is just a poor mans job queue
00:22 sri but it's fragile and bound to fail, web servers like hypnotoad watch active requests and restart workers when there are none active
00:23 sri which could kill your async request
00:24 buu ummmmmmmmmmmmmmmmmmmmmm
00:24 buu Hrm.
00:27 sri actually i lied, in the case of Mojo::UserAgent the event loop knows not to stop, but it's the case with 3rd party libraries like AnyEvent::*
00:28 sri so you can't really count on it
00:29 buu sri: Basically what I have is a handler that receives requests and sets up some data and under certain conditions it needs to launch another request to a different handler to execute its particular actions, but handler 1 doesn't need to know about the results of handler 2
00:29 buu So I have {outside systems} -> /handler1 -> /handler2
00:30 buu I don't want to make handler1 -> handler2 a synchronous or internal request because I don't want {outside systems} waiting on the results of handler2
00:38 shmuel joined #mojo
00:39 sri buu: i think what you really want is $self->on(finish => sub {...})
00:39 sri no need for an internal request, that event runs after the whole response has been sent
00:41 buu Ah.. interesting.
01:04 basic6_ joined #mojo
01:16 Molaf__ joined #mojo
01:36 punter joined #mojo
01:59 d4rkie joined #mojo
03:10 KindTwo joined #mojo
03:24 preflex_ joined #mojo
03:54 dvinciguerra joined #mojo
04:02 jwang joined #mojo
04:08 freman don't suppose it's at all possible to use Mojolicious::Plugin::Config without loading mojo?
04:29 dqw joined #mojo
04:29 crab no.
04:29 crab why do you want to?
04:30 crab it's really just an eval. if you want to do it in a non-mojo context, just copy that bit.
04:49 mrphilov joined #mojo
04:53 KindTwo joined #mojo
05:15 Meiermann joined #mojo
05:16 hummeleBop joined #mojo
05:21 mrphilov left #mojo
05:34 KindOne joined #mojo
06:02 some_dood joined #mojo
06:03 some_dood joined #mojo
06:27 dpetrov_ joined #mojo
06:38 Britzel_ joined #mojo
07:21 basiliscos joined #mojo
07:34 perlite joined #mojo
07:47 nic_ joined #mojo
07:48 rem_lex| joined #mojo
07:49 nic__ joined #mojo
08:07 tianon joined #mojo
08:21 maxhq joined #mojo
08:24 fhelmber_ joined #mojo
08:24 KindTwo joined #mojo
08:44 Vandal joined #mojo
08:45 KindTwo joined #mojo
09:34 moltar joined #mojo
09:34 mire joined #mojo
09:43 KindTwo joined #mojo
09:48 MeierM joined #mojo
09:49 sh4 joined #mojo
09:54 dqw joined #mojo
10:05 dotandimet joined #mojo
10:07 sh4 joined #mojo
10:09 marty joined #mojo
10:11 yakudza joined #mojo
10:22 KindOne joined #mojo
10:34 dsteinbrunner joined #mojo
10:59 basic6__ joined #mojo
11:02 basic6__ How do I configure the Port or PID file used by Hypnotoad? I've copy&pasted the example line from the docs but it ($ hypnotoad -f myapp.pl) still listens on :8080: http://mojolicio.us/perldoc/Mojol​icious/Guides/Cookbook#Hypnotoad (I've replaced app->config with $self->app->config because it's not a lite app, is that correct?)
11:05 denisboyun joined #mojo
11:11 bowtie_ joined #mojo
11:14 jzawodn joined #mojo
11:18 marty_ joined #mojo
11:19 nic basic6__: Are you doing that within 'startup'?
11:24 basic6__ nic yes
11:24 nic basic6__: Then you probably want "$self->config(..)"
11:27 basic6__ nic ok i have replaced $self->app->config with $self->config (also i replaced port 80 with 8081 to make make sure i'm not running into permisison issues) but still it says Server available at http://127.0.0.1:8080.
11:33 nic basic6__: If you can put a minimal example somewhere, someone will spot the error (I'm nipping out for 75mins)
11:33 basic6__ This is what I have in my startup sub: $self->config(hypnotoad => {listen => ['http://*:8081']}); (like I said, basically copy&pasted from the docs, so i assume there's no syntax error)
11:34 basic6__ nic maybe someone else has an idea. thank you anyway
11:39 nicolaas joined #mojo
11:39 nicolaas_ joined #mojo
11:47 marty joined #mojo
11:47 dqw joined #mojo
11:48 jzawodn joined #mojo
12:23 arthas joined #mojo
12:24 marty_ joined #mojo
12:38 * sri yawns
12:40 asarch joined #mojo
12:43 dqw joined #mojo
13:39 gryphon joined #mojo
13:44 Britzel joined #mojo
14:01 KindOne joined #mojo
14:13 yakudza joined #mojo
14:14 moltar joined #mojo
14:15 d4rkie joined #mojo
14:18 mattp sri: out of curiousity, what is your attachment to perl 5? (sorry for channel switch, felt bad hijacking #p5-mop)
14:18 sri mattp: what do you mean?
14:19 mattp you mentioned you'd jump to p6 the second it is feasible
14:19 sri right
14:20 mattp why havent you gone to another language entirely in the interim?
14:20 sri i like multi-paradigm languages and curly brackets
14:21 PerlJam mattp: what other language would you suggest?  ;)
14:21 sri what real options are there?
14:22 sri heh
14:24 KindOne joined #mojo
14:24 mattp scala? :) I wasn't suggesting there was, i've not got much professional knowledge outside of the perl bubble
14:25 KindTwo joined #mojo
14:25 sri scala is no fun for scripting
14:46 bluescreen joined #mojo
14:49 bowtie_ joined #mojo
15:05 mire joined #mojo
15:10 dqw joined #mojo
15:12 bluescreen_ joined #mojo
15:26 perl2012 joined #mojo
15:26 dvinciguerra_ joined #mojo
15:28 HtbaaPi joined #mojo
15:47 jamadam joined #mojo
16:21 delias joined #mojo
16:22 travis-ci joined #mojo
16:22 travis-ci [travis-ci] adammenges/mojo#2 (fix - 53856c4 : Adam Menges): The build was broken.
16:22 travis-ci [travis-ci] Change view : https://github.com/adammenges/mojo/​compare/6bbad3460b64...53856c406db2
16:22 travis-ci [travis-ci] Build details : http://travis-ci.org/adamm​enges/mojo/builds/10415900
16:22 travis-ci left #mojo
16:25 sri ok, this starts to get annoying... guess i'll have to disable notifications
16:33 travis-ci joined #mojo
16:33 travis-ci [travis-ci] adammenges/mojo#3 (fix - 8c75b7c : Adam Menges): The build is still failing.
16:33 travis-ci [travis-ci] Change view : https://github.com/adammenges/mojo/​compare/53856c406db2...8c75b7c6c096
16:33 travis-ci [travis-ci] Build details : http://travis-ci.org/adamm​enges/mojo/builds/10416233
16:33 travis-ci left #mojo
16:36 good_news_everyone joined #mojo
16:36 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/R53mTw
16:36 good_news_everyone mojo/master 171198d Sebastian Riedel: no more IRC notifications
16:36 good_news_everyone left #mojo
16:36 tempire not too long ago, there was a tool mentioned here that was better than ab
16:37 sri wrk
16:37 tempire was there something wrong with ab?
16:37 sri yea, it's garbage
16:38 denisboyun joined #mojo
16:39 travis-ci joined #mojo
16:39 travis-ci [travis-ci] adammenges/mojo#4 (fix - 8803e41 : Adam Menges): The build was fixed.
16:39 travis-ci [travis-ci] Change view : https://github.com/adammenges/mojo/​compare/8c75b7c6c096...8803e41bd056
16:39 travis-ci [travis-ci] Build details : http://travis-ci.org/adamm​enges/mojo/builds/10416475
16:39 travis-ci left #mojo
16:39 sri wtf?
16:41 sri i suppose that adammenges guy enabled travis manually... that's why it spams us
16:42 sri THAT'S WHY WE CAN'T HAVE NICE THINGS
16:47 tianon sri: https://github.com/adammenge​s/mojo/blob/fix/.travis.yml <- sad pandas methinks; he has no idea it's spamming us, I'm sure
17:01 batman sri: do you have any plans adding promise/deferred to Mojo?
17:08 denis_boyun joined #mojo
17:15 hummeleBop joined #mojo
17:16 sri batman: i hate promises
17:16 batman seriously? why?
17:16 sri batman: before you start arguing... give me an example where promises make a mojolicious api better
17:17 batman i'm thinking caching and synchronizing of events
17:17 sri examples as in code
17:18 batman okey.
17:19 batman will think about it...
17:19 batman but i don't get how it's possible to hate promises :)
17:24 sri batman: then show me why you like promises! ;p
17:24 batman haha. it's just that "hate" is such a strong word...
17:24 sri i've played extensively with them actually, and they end up making my code more verbose and ugly
17:25 * sri hates ugly code
17:25 batman i see
17:25 delias joined #mojo
17:27 sri batman: have you actually used promises yet?
17:27 sri in perl
17:29 sri in their basic form they are just more verbose callbacks, what makes them actually cool are coroutines/generators
17:29 sri it annoys me so much when people mix those up
17:30 sri we can't have *cool* promises in perl, because those constructs are missing from the language
17:33 russum joined #mojo
17:35 russum left #mojo
17:35 sri you hear things like "promises in scala are so cool"... but what nobody mentions... THEY ALSO HAVE ACTORS TO GO WITH THOSE!!!
17:39 russum joined #mojo
17:42 * batman thinks about $.Deferred and $.Callbacks from jQuery...
17:45 tempire so I'm doing micro benchmarks.
17:45 tempire for the purpose of learning about wrk and ab
17:46 * tempire ducks
17:47 tempire I had assumed EV would increase performance dramatically, even with tiny things.
17:47 dvinciguerra_ joined #mojo
18:13 sri tempire: you assumed wrong
18:14 tempire indeed
18:14 sri EV can increase performance slightly, but it's generally used for scalability
18:15 sri can't do c10k with poll()
18:17 sri https://gist.github.com/kraih/5551292
18:18 * tempire learns
18:23 mire joined #mojo
18:28 jast joined #mojo
19:01 travis-ci joined #mojo
19:01 travis-ci [travis-ci] adammenges/mojo#7 (testing - 25f60b9 : Adam Menges): The build passed.
19:01 travis-ci [travis-ci] Change view : https://github.com/adammeng​es/mojo/commit/25f60b9cc02d
19:01 travis-ci [travis-ci] Build details : http://travis-ci.org/adamm​enges/mojo/builds/10421651
19:01 travis-ci left #mojo
19:04 moltar joined #mojo
19:06 sri ARGH!
19:09 sri Bender: trust wsri
19:09 Bender OK, sri
19:09 sri Bender: trust marty
19:09 Bender sri, I already trust marty
19:09 sri Bender: spread the love
19:11 sri i think that guy is only testing his changes with travis and doesn't have mojolicious installed :o
19:21 dotandimet joined #mojo
19:26 Mike-PerlRecruiter_ joined #mojo
19:33 bluescreen_ joined #mojo
19:41 punter joined #mojo
19:44 punter I think I found a bug: When UserAgent attempts to connect to a nonexistent websocket server, the callback of the connection only gets called after 'inactivity_timeout' seconds, instead of 'connect_timeout' seconds
19:56 punter How can I catch a connect_timeout that occurred in Mojo::UA with a websocket request?
19:58 punter I mean, WHEN it happens, and not after inactivity_timeout seconds
19:59 vervain joined #mojo
20:05 HtbaaPi joined #mojo
20:17 HtbaaPi joined #mojo
20:19 sri wow, ->pluck() is over a year old already :o
20:19 sri time flies
20:29 dotandimet joined #mojo
20:38 punter sri: I don't know if you're getting notifications on bugs that have closed, but I just posted a comment on the latest closed bug with code that replicates the bug
20:38 punter thought I should let you know
20:38 sri and i answered
20:39 sri there is so much wrong i wouldn't know where to begin
20:40 punter One mistake is placing use EV inthe App.pm instead of the main program, ,right?
20:40 punter I moved it in the main script and the error doesn't go away
20:40 punter Ok, could you please give me an idea of what else might be wrong there?
20:40 punter Or I'll ask the mailing list
20:42 punter There might be a million problems, but I think the UserAgent should behave differently
20:43 punter Can anybody please check the source code in the comments of this page and advise me how to fix it? https://github.com/kraih/mojo/i​ssues/529#issuecomment-22972911
20:47 punter or, if not fix it, then at least tell me what's wrong?
20:47 punter one of the many things that are wrong?
20:50 sri look, that's not how it works, people don't just ask you questions until they can help you... you post more and more information until you find the problem yourself or someone else does
20:51 sri that example application makes no sense whatsoever
20:51 sri nothing about it is right
20:53 sri but if you insist on me pointing out something... WTF is App? that's not even remotely close to being a mojolicious application
20:53 sri it's a namespace you pollute with stuff and let it get garbage collected right away again... it makes no sense!
20:56 delias joined #mojo
20:57 sri i should take a break from answering tickets -.-
20:58 * tempire watches the rampaging sri
20:58 tempire http://threatormenace.com/wp-cont​ent/uploads/2012/11/Wreck-It1.jpg
20:59 sri RAR SRI SMASH!
20:59 sri hey, how did you get that picture of me? :O
21:02 Meiermann joined #mojo
21:16 buu So speaking of my earlier problem with single threaded test servers, would it be completely insane to create a new $ua with a new instance of $app and then make requests against it?
21:16 buu Inside a current request
21:44 punter Now I've posted a better example at the bottom of the bug page: https://github.com/kraih/mojo/issues/529
21:44 punter much better, I should say
21:44 punter $guard doesn't get garbage-collected, because it's an "our" variable
22:00 TitanOfOld joined #mojo
22:03 cooper joined #mojo
22:13 sri "I've even seen designs where if you don't pass in a callback the operation is synchronous -- that's bad enough I'd give it zero stars." -- Guido van Rossum
22:13 sri :D
22:15 marty Who's Guido anyway.   :D
22:16 sri quote from here btw. https://groups.google.com/forum/#!topi​c/python-tulip/ut4vTG-08k8/discussion
22:32 sri punter: why would the connect timeout fire if the connection is a success?
22:32 sri the timer delays the connect until after the server has started listening
22:33 punter sri: I know, I got confused and forgot to write that the websocket server should be nonexistent
22:33 punter So the connection is a failure
22:33 sri if you know that already you should have corrected that
22:34 punter You're right. I'm going to do it right away
22:34 sri i just looked into it wasting 10 minutes...
22:34 sri gonna leave it to someone else now
22:35 punter ok
22:37 sri in fact, i'm gonna stick with helping those that help others again
22:40 sri adn watch the latest breaking bad episode \o/
22:42 punter sri: Problem solved (see bug page)
22:43 punter sri: I couldn't help anyone with my level of knowledge. Yet oftentimes there's noone else here to help me but you. :-)
22:44 sri irc is a wasteland during the summer
23:04 vervain joined #mojo
23:26 * tempire tumbleweeds
23:26 dsteinbrunner joined #mojo
23:30 * sri wonders if anyone actually gets the oneliner he tweeted
23:31 sri oh, almost forgot...
23:32 sri tempire: MANGOCAST!!!
23:42 gryphon joined #mojo
23:51 punter joined #mojo

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