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

IRC log for #mojo, 2014-06-18

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

All times shown according to UTC.

Time Nick Message
00:03 sri hmm, apparently this has a very good chance for being the last http/2 draft :o http://tools.ietf.org/html/draft-ietf-httpbis-http2-13
00:21 cpan_mojo joined #mojo
00:21 * jberger tries to make cpan_mojo get deps to a module faster
00:22 * jberger should make cpan_mojo a little more non-blocking tho
00:25 jberger it is now doing too many things blocking once it gets a message from friendfeed :s
00:27 russum joined #mojo
00:39 sugar__ joined #mojo
00:44 sugar joined #mojo
01:07 laouji joined #mojo
01:22 disputin joined #mojo
01:23 klapperl joined #mojo
01:25 Averna joined #mojo
01:37 zivester joined #mojo
01:57 D4RK-PH0ENiX joined #mojo
01:58 Adura Yes... Minion's tests run now.
01:58 Adura jberger, things fixed?
02:02 jberger Nothing was broken, it just wasn't fid enough
02:02 jberger s/fid/good/ # bleading swipe type
03:02 d4rkie joined #mojo
03:16 chankey joined #mojo
03:18 genio batman: Dangit!  Why'd you get me started on this?  I'm going to go all crazy making a HAL, Siren, and JSON-API compliant cookieville
03:19 genio :) it's a good night-time project for me to relax after working on the house though
03:36 disputin joined #mojo
03:53 D4RK-PH0ENiX joined #mojo
04:15 elik joined #mojo
04:26 laouji joined #mojo
04:27 elik joined #mojo
04:27 D4RK-PH0ENiX joined #mojo
04:27 Averna joined #mojo
04:27 klapperl joined #mojo
04:27 sugar joined #mojo
04:27 russum joined #mojo
04:27 cpan_mojo joined #mojo
04:27 marty joined #mojo
04:27 dotan1 joined #mojo
04:27 rem_lex| joined #mojo
04:27 r0b3rt joined #mojo
04:27 TenshiLyle joined #mojo
04:27 abhishekisnot joined #mojo
04:27 Godsey joined #mojo
04:27 alnewkirk joined #mojo
04:27 dexteruk joined #mojo
04:27 ryanc joined #mojo
04:27 KindOne joined #mojo
04:27 bobkare joined #mojo
04:27 maze joined #mojo
04:27 jberger joined #mojo
04:27 Lee joined #mojo
04:27 Zx3 joined #mojo
04:27 Adura joined #mojo
04:27 ivan joined #mojo
04:27 kbenson1 joined #mojo
04:27 davido__ joined #mojo
04:27 Foxcool joined #mojo
04:27 inokenty joined #mojo
04:27 jeff joined #mojo
04:27 dgikiller joined #mojo
04:27 espen_ joined #mojo
04:27 dwierenga joined #mojo
04:27 test777 joined #mojo
04:27 jnbek joined #mojo
04:27 batman joined #mojo
04:27 allison joined #mojo
04:27 genio joined #mojo
04:27 andrefs joined #mojo
04:27 sawtooth joined #mojo
04:27 lestrrat joined #mojo
04:27 charsbar___ joined #mojo
04:27 mikegrb joined #mojo
04:27 throughnothing joined #mojo
04:27 phillipadsmith joined #mojo
04:27 chansen joined #mojo
04:27 Ralesk joined #mojo
04:27 jzawodn joined #mojo
04:27 Phil21 joined #mojo
04:27 bjoernfan joined #mojo
04:27 salparadise joined #mojo
04:27 stokachu joined #mojo
04:27 yko joined #mojo
04:27 nic joined #mojo
04:27 mattp joined #mojo
04:27 Mikey joined #mojo
04:27 diegok joined #mojo
04:27 mudler joined #mojo
04:27 memowe joined #mojo
04:27 DaTa joined #mojo
04:27 bowtie joined #mojo
04:27 cotto joined #mojo
04:27 tempire joined #mojo
04:27 rblackwe joined #mojo
04:27 cooper joined #mojo
04:27 preaction joined #mojo
04:27 ironcamel joined #mojo
04:27 sri joined #mojo
04:27 omega joined #mojo
04:27 Rallias joined #mojo
04:27 hkclark joined #mojo
04:27 romel joined #mojo
04:50 sri jberger: regarding your $self/$c plans, i don't think it's a pure documentation change, for consistency it might also be necessary to replace $self in ep templates with $c
04:59 elik joined #mojo
04:59 D4RK-PH0ENiX joined #mojo
04:59 Averna joined #mojo
04:59 klapperl joined #mojo
04:59 sugar joined #mojo
04:59 russum joined #mojo
04:59 cpan_mojo joined #mojo
04:59 marty joined #mojo
04:59 dotan1 joined #mojo
04:59 rem_lex| joined #mojo
04:59 r0b3rt joined #mojo
04:59 TenshiLyle joined #mojo
04:59 abhishekisnot joined #mojo
04:59 Godsey joined #mojo
04:59 alnewkirk joined #mojo
04:59 dexteruk joined #mojo
04:59 ryanc joined #mojo
04:59 KindOne joined #mojo
04:59 bobkare joined #mojo
04:59 maze joined #mojo
04:59 jberger joined #mojo
04:59 Lee joined #mojo
04:59 Zx3 joined #mojo
04:59 Adura joined #mojo
04:59 ivan joined #mojo
04:59 kbenson1 joined #mojo
04:59 davido__ joined #mojo
04:59 Foxcool joined #mojo
04:59 inokenty joined #mojo
04:59 jeff joined #mojo
04:59 dgikiller joined #mojo
04:59 espen_ joined #mojo
04:59 dwierenga joined #mojo
04:59 test777 joined #mojo
04:59 jnbek joined #mojo
04:59 batman joined #mojo
04:59 allison joined #mojo
04:59 genio joined #mojo
04:59 andrefs joined #mojo
04:59 sawtooth joined #mojo
04:59 lestrrat joined #mojo
04:59 charsbar___ joined #mojo
04:59 mikegrb joined #mojo
04:59 throughnothing joined #mojo
04:59 phillipadsmith joined #mojo
04:59 chansen joined #mojo
04:59 Ralesk joined #mojo
04:59 jzawodn joined #mojo
04:59 Phil21 joined #mojo
04:59 bjoernfan joined #mojo
04:59 salparadise joined #mojo
04:59 stokachu joined #mojo
04:59 yko joined #mojo
04:59 nic joined #mojo
04:59 mattp joined #mojo
04:59 Mikey joined #mojo
04:59 diegok joined #mojo
04:59 mudler joined #mojo
04:59 memowe joined #mojo
04:59 DaTa joined #mojo
04:59 bowtie joined #mojo
04:59 cotto joined #mojo
04:59 tempire joined #mojo
04:59 rblackwe joined #mojo
04:59 cooper joined #mojo
04:59 preaction joined #mojo
04:59 ironcamel joined #mojo
04:59 sri joined #mojo
04:59 omega joined #mojo
04:59 Rallias joined #mojo
04:59 hkclark joined #mojo
04:59 romel joined #mojo
05:02 d4rkie joined #mojo
05:32 edestler joined #mojo
05:58 Eke- joined #mojo
06:07 mire joined #mojo
06:15 Eke|| joined #mojo
06:17 preaction cpan_mojo: GumbyPAN beat you for the first time!
06:17 batman genio: hehe... What I would like to know is when I can remove the experimental notice from
06:17 batman ...the project
06:18 batman genio: also, would you mind contributing to cookieville, instead of making another project?
06:41 laouji joined #mojo
06:41 laouji joined #mojo
06:42 dod joined #mojo
06:43 ghandi|work joined #mojo
06:44 ghandi|work Hi There, got some troubles/misunderstandment of the error handling with Mojo::UA and websockets.
06:44 ghandi|work Got this little snippet: https://gist.github.com/ghandmann/a2fc0bbb2392fbd8822c
06:44 ghandi|work Fatal errors in the event-handlers don't ever come up, so that i could handle them or find out what was going wrong?
06:45 ghandi|work See lines 31-33 where i die in the on-message handler
06:46 ghandi|work Although i registered to error-event in the UserAgent and the transaction?
06:48 ghandi|work Running the script with MOJO_EVENTEMITTER_DEBUG=1 shows that an error-event is emitted, but i never see it?
06:50 igorsutton joined #mojo
06:50 mire joined #mojo
06:58 crab what error event do you see being emitted?
06:58 ghandi|work -- Emit error in Mojo::IOLoop::Stream (1)
07:00 ghandi|work Updated the gist to include the entire Output of the script: https://gist.github.com/ghandmann/a2fc0bbb2392fbd8822c
07:00 crab i don't think that's relevant
07:00 crab it's probably just the connection close or some such
07:01 ghandi|work Connection isn't closed by the echo-server, if i comment out the die() in line 32 it stays connected and waiting for inactivity_timeout
07:01 ghandi|work Which also doesn't give an explanatory message if the connection gets closed after inactivity_timeout
07:02 eseyman joined #mojo
07:02 crab -- Emit message in Mojo::Transaction::WebSocket (1)
07:02 crab -> MSG: Fail this one!
07:04 crab the reason you're not seeing the behaviour you expect is that M::T::WebSocket is using ->emit(message => ...) rather than emit_safe(message => ...). the latter catches errors and emits an error.
07:04 crab so the die is being caught elsewhere and the connection closed.
07:04 crab and the error you're seeing is therefore caused by the die, but nevertheless not the error you want.
07:04 crab do you understand?
07:04 purl Zen moment: When we understand that we cannot understand, we begin to understand.
07:05 crab what i'm saying is, the error event you're seeing is anyway not the sort that would be delivered to the error callback you have.
07:05 ghandi|work crab: i understand. But as far as i understood the documentation: If you don't catch on(error =>...) you get a fatal error. If you catch it, you can do whatever you want. I try to catch erorr at UserAgent-Level and transaction-level but still only get a finish-event
07:06 crab as for why it's using emit and not emit_safe, i can't say. i would think you should emit the error yourself instead of dying.
07:06 crab but i'm not the best person to give advice on this particular subject.
07:07 ghandi|work The realy bad thing about this is, that even runtime-errors get "captured away" by a finish-event. If i try to call $tx->SomeUnknwonMethod(); in on(message...) i still only get at finish event...
07:07 ghandi|work makes development i bit tedious :D
07:07 ghandi|work *a
07:09 crab ghandi: if you hang around, somebody more clueful than me will tell you the right thing to do.
07:09 ghandi|work thanks anyway, i stay patient ;)
07:10 crab is your nick supposed to be read as "g, h, and i"?
07:10 ghandi|work no, like mahatma gandhi but spelled incorect :D
07:10 ghandi|work even though i'm german ;)
07:10 crab argh!
07:14 basiliscos joined #mojo
07:31 Eke- joined #mojo
07:33 rawler joined #mojo
07:42 trone joined #mojo
07:46 Vandal joined #mojo
08:11 laouji_ joined #mojo
08:23 denis_boyun joined #mojo
08:25 laouji joined #mojo
08:28 laouji_ joined #mojo
08:42 dpetrov_ joined #mojo
08:44 laouji joined #mojo
08:47 fhelmber_ joined #mojo
08:56 laouji joined #mojo
08:58 chankey joined #mojo
09:03 laouji joined #mojo
09:14 chankeypathak joined #mojo
09:46 laouji joined #mojo
09:46 laouji joined #mojo
10:37 meshl joined #mojo
10:38 laouji joined #mojo
10:52 alnewkirk joined #mojo
11:02 laouji joined #mojo
11:04 laouji_ joined #mojo
11:06 neilhwatson joined #mojo
11:25 ghandi|work So maybe now somebody can help me out :)
11:26 bodgix joined #mojo
11:26 ghandi|work I've got a problem with WebSockets and errors in the Event-Handlers, see original question here: http://irclog.perlgeek.de/mojo/2014-06-18#i_8890947
11:26 ghandi|work It's about that gist: https://gist.github.com/ghandmann/a2fc0bbb2392fbd8822c
11:27 ghandi|work Where i don't get fatals errors thrown in the on(message...) handler in line 32
11:27 ghandi|work Even runtime-errors aren't reported, which makes debugging/development quite complicated...
11:35 basiliscos joined #mojo
11:39 abra joined #mojo
11:41 crab nope, still only me ;-)
11:44 d4rkie joined #mojo
11:52 rem_lex|pivo joined #mojo
11:53 neilhwatson ghandi|work: did you try a packet dump to see the actual conversation?
11:55 abra joined #mojo
12:02 jberger ghandi|work: try subscribing to the reactor's error event
12:03 laouji joined #mojo
12:04 jberger Without any extra context it does seem that the websocket events ought to be emitted safely, but maybe sri has some more info
12:06 jberger sri: I see no reason for the template to provide $self, the problem is that in the Lite documentation it makes it seem as if the controller actions might be passed the app rather than the controller
12:07 jberger Grrr, no reason NOT to provide $self
12:10 laouji joined #mojo
12:16 jberger sri: does the transaction subscribe to the stream' error event in order to close the connection and therefore prevent the error from bubbling up?
12:25 TenshiLyle joined #mojo
12:33 ghandi|work neilhwatson: no i didn't. But as far as i think it's not protocol specific. If comment out the die(), the connection stays active until the default inactivity_timeout(). But this is only a prediction, because in this case i also become only a finish-event with $code 1006
12:34 ghandi|work But playing around with inactivty_timeout() and counting the seconds matches quite well ;)
12:34 ghandi|work jberger: How can i access the corresponding stream-object for this UserAgent/Transaction to register the error event?
13:01 jberger_ joined #mojo
13:01 neyasov joined #mojo
13:02 jberger_ ghandi|work the same way you do to increase the timeout
13:03 jberger_ http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#REAL-TIME_WEB
13:03 ghandi|work inactivity_timeout() is provided by Mojo::UserAgent, i already register $ua->on(error...) in line 7. But i currently don't see a reactor attribute/method in Mojo::UA?
13:04 jberger_ http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#WebSocket_web_service
13:04 jberger_ I don't think the reactor will help
13:05 ghandi|work Not sure if this is applicable in my case: I'm not trying to do a request on behalf of an Mojolicious-Request, i just use Mojo::UserAgent with another Websocket service?
13:11 jberger_ That should not matter
13:17 jberger_ ghandi|work: in the finish handler, check the error response's error attribute
13:18 jberger_ $tx->res->error
13:19 genio batman: I say go ahead and remove the experimental.  The regular JSON responses you're providing already work fine.  You can provide the other responses based on given information (in headers or in the JSON requests themselves).
13:19 jberger_ If that contains the error then at least I understand the code path
13:20 genio Also, I will be contributing (not making my own).  Since I'm working on quite a few things and didn't have time to complete anything last night, I figure it's just best to work on my own fork until I have something I can show you to see if you like it
13:21 zivester joined #mojo
13:21 ghandi|work $tx->res->error indeed contains the die()-Message
13:22 ghandi|work [TX-ERROR] $VAR1 = {'message' => 'Event "read" failed: Failing hard... at test.pl line 35.'};
13:26 marty joined #mojo
13:28 jberger_ When you connect, the user agent connects to the stream's error event here : https://github.com/kraih/mojo/blob/master/lib/Mojo/UserAgent.pm#L115
13:28 jberger_ Since it does, the error doesn't bubble up
13:28 jberger_ The rest of the code path is pretty easy to follow from there
13:29 batman genio: awesomelicious! :)
13:30 jberger_ You could play some shenanigans with the subscribers to that event
13:30 batman i will add Cookieville::Client first and try it out a bit more @work before i remove EXPERIMENTAL
13:30 crab what's cookieville?
13:30 batman genio: i really appreciate your patches or any input to make it better - more useful
13:31 jberger_ But perhaps you are better to just catch your own errors in that message handler
13:31 batman crab: https://metacpan.org/pod/Cookieville#DESCRIPTION Cookieville is a a web application which allow you to inspect and run queries on your SQL database using a REST interface.
13:32 batman i think the name is quite descriptive... is that just me...?
13:32 batman ;)
13:33 batman genio: i'm also considering basic filtering and authentication by using a token in a header.
13:33 * batman will go and drink beer
13:33 batman *bbl*
13:33 jberger_ sri: given this information, is there any reason why the websocket message-like events aren't emitted safely
13:33 jberger_ ?
13:34 jberger_ It doesn't seem to do what you mean otherwise
13:34 jberger_ But maybe I'm missing something
13:35 ghandi|work jberger_ already started to try-catch the stuff by myself and emit an Error-Event to the outside. But took me some time to get this far. ;)
13:36 ghandi|work Especially that runtime-errors get silently wrapped into a finish-handeler ist quite bad. If you just decode some Json-data which fails you just haven't a clue what was going wrong...
13:43 jberger_ ghandi|work: that basically is what emit_safe does
13:43 jberger_ And yeah
13:44 jberger_ Well done posting the event emitter debug output, it made it much easier for me to form a theory
13:46 mire joined #mojo
13:50 crab is your theory the same as mine?
13:50 crab that if it used emit_safe it would work as ghandi|work expects?
13:51 crab there must be some reason why it doesn't, though
13:52 ghandi|work i might have overseen something in the docs, but the current behavior isn't really intuitive :)
13:53 crab this is all punishment for having a purposely-misspelled nick, you know
13:53 ghandi|work ;)
14:02 bluescreen joined #mojo
14:07 btyler joined #mojo
14:15 bodgix joined #mojo
14:19 arthas joined #mojo
14:29 sh4 joined #mojo
14:43 memowe joined #mojo
14:44 Vandal joined #mojo
14:44 rem_lex|pivo joined #mojo
14:45 igorsutton joined #mojo
14:46 disputin joined #mojo
14:47 Zx3 joined #mojo
14:48 espen_ joined #mojo
14:48 Phil21 joined #mojo
14:48 andrefs joined #mojo
14:48 dwierenga joined #mojo
14:49 omega joined #mojo
14:49 ironcamel joined #mojo
14:49 romel joined #mojo
14:49 trone joined #mojo
14:49 throughnothing joined #mojo
14:49 cotto joined #mojo
14:50 stokachu joined #mojo
14:50 sri joined #mojo
14:50 alnewkirk joined #mojo
14:50 yko joined #mojo
14:51 DaTa joined #mojo
14:51 dgikiller joined #mojo
14:51 batman joined #mojo
14:51 ivan joined #mojo
14:51 test777 joined #mojo
14:53 mire joined #mojo
14:54 sri promises are really not pretty without native support http://dokechin.hatenablog.com/entry/2014/06/18/183446
14:59 meshl joined #mojo
15:03 marty joined #mojo
15:32 abra joined #mojo
15:38 neyasov_ joined #mojo
15:39 genio Browsers++ # translating things so I can more or less understand :)
15:41 neyasov__ joined #mojo
15:44 disputin joined #mojo
15:45 mad_hatter joined #mojo
15:45 Godsey sri: promises are what got me interested in scala/play
15:45 mad_hatter do helpers need to be defined before routes?
15:46 Godsey I'm not sure if I'm dense or what but I keep coming back to perl because I'm more productive. I don't seem to pick up new languages quickly.
15:46 russum joined #mojo
15:46 d4rkie joined #mojo
15:47 sri with expressiveness comes great productivity
15:48 Godsey I've thought of myself thinking in perl since 95~~
15:48 sri for me it's usually getting annoyed with other languages being less expressive
15:49 Godsey autovivication -- $X->{blah}->{blah} hashes are the most useful thing in my toolbox :)
15:50 Godsey probably because I haven't taken the time to properly learn and embrace oop
15:50 sri that looks like autovivification--
15:51 Godsey when doing java or c++ I keep wanting to do HashMap<String, Anything :)>
15:53 Godsey so once I get a few levels into new HashMap<String,HashMap<String,Integer>> I put it aside and just use perl to get it done w/ out getting a headache :)
15:53 r0b3rt joined #mojo
15:53 Godsey but promises and threads are a little easier there
15:55 mad_hatter do helpers need to be defined before routes are setup or can you just place them anywhere?
15:59 cfedde Is there a reasonable way to work with very large message bodies? I have a big XML response that execeeds the default $msg->max_message_size.  I can simply bump this but I expect that the result set will grow very large and exceed convenient ram over the lifetime of this script.
16:03 nicomen use a xml sax parser?
16:03 cfedde but but but mojo::dom is so convenient....
16:04 cfedde I guess I have no choice.
16:05 nicomen cfedde: it needs to build a tree...
16:05 nicomen maybe you can divide the tree in parts?
16:05 odc use regex ;)
16:08 marty joined #mojo
16:10 disputin joined #mojo
16:24 marty joined #mojo
16:29 * genio stabs odc with something mildly sharp
16:29 disputin joined #mojo
16:30 cfedde it's regex.  All the way down.
16:30 odc ouch!
16:30 moritz stab it with a sharp regex!
16:34 genio s/\A.*\z/STABBITY DEATH!/
16:38 odc in my case, using regex to parse XML was a lot faster than any of the other parsers. Having base64 encoded jpeg images inside the xml doesn't help...
16:43 bobkare joined #mojo
16:43 marty joined #mojo
16:44 denis_boyun joined #mojo
16:44 irq joined #mojo
16:46 marty joined #mojo
16:46 disputin joined #mojo
16:48 basiliscos joined #mojo
17:04 marty joined #mojo
17:43 disputin joined #mojo
18:11 btyler joined #mojo
18:27 marty joined #mojo
18:38 marty joined #mojo
18:41 marty_ joined #mojo
18:53 denis_boyun joined #mojo
18:57 denis_boyun_ joined #mojo
19:01 bobkare joined #mojo
19:09 ua_ joined #mojo
19:30 dod joined #mojo
19:31 mire joined #mojo
19:53 irq joined #mojo
20:00 marty joined #mojo
20:00 marty_ joined #mojo
20:01 marty joined #mojo
20:02 marty joined #mojo
20:06 marty joined #mojo
20:57 sugar joined #mojo
21:02 btyler_ joined #mojo
21:04 btyler_ joined #mojo
21:05 meshl joined #mojo
21:09 sugar joined #mojo
21:12 mire joined #mojo
21:18 sri for those that want to learn the basivs of http/2, this is not bad http://daniel.haxx.se/http2/http2-v1.5.pdf
21:25 disputin joined #mojo
21:29 bluescreen joined #mojo
21:33 * tempire reads
21:34 jberger__ joined #mojo
21:43 bodgix joined #mojo
21:54 basiliscos joined #mojo
22:01 bobkare joined #mojo
22:05 sri jberger: btw. did you find out if forkcall works inside a real app?
22:15 bobkare joined #mojo
22:29 bobkare joined #mojo
22:57 drift joined #mojo
23:31 bobkare joined #mojo
23:32 d4rkie joined #mojo
23:52 bobkare joined #mojo

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