Camelia, the Perl 6 bug

IRC log for #mojo, 2011-10-25

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

All times shown according to UTC.

Time Nick Message
00:25 dmn001 joined #mojo
00:42 gabriel__ joined #mojo
00:45 mercutioviz joined #mojo
01:02 GitHub55 joined #mojo
01:02 GitHub55 [mojo] kraih pushed 1 new commit to master: http://git.io/YWmC5w
01:02 GitHub55 [mojo/master] added experimental frame support to Mojo::Message::WebSocket and changed syntax for binary messages - Sebastian Riedel
01:02 GitHub55 left #mojo
01:03 sri this might seem a little crazy… because it is :)
01:03 Alias_ oh dear
01:03 Alias_ runs
01:03 Alias_ left #mojo
01:03 sri \o/
01:05 sri controlling frames is *a lot* of power, but i think it could be fun for testing and playing with WebSocket extensions
01:07 f00li5h joined #mojo
01:10 tempire If I knew what that meant, I would protest the crazy
01:11 * tempire looks for something else to watch on netflix
01:13 MojoGuest917 joined #mojo
01:13 MojoGuest917 From: http://www.google.com/url?sa=t&rct=j&q​=websocket%20client%20demo&source=web&​cd=5&ved=0CDUQFjAE&url=http%3A%2F%2Fde​v.xantus.org%2F&ei=1QmmTrL_GsWBsgK0gv3gDw&​amp;usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (1 hits)
01:13 sri websockets can do a lot of cool things, like fragment messages into multiple frames, or send ping/pong
01:13 sri it's all protocol level, and i'm opening that up
01:14 GitHub1 joined #mojo
01:14 GitHub1 [mojo] kraih pushed 1 new commit to master: http://git.io/dHbaJw
01:14 GitHub1 [mojo/master] message event should not depend on the frame event - Sebastian Riedel
01:14 GitHub1 left #mojo
01:16 sri with the frame event you can basically watch the protocol layer
01:17 sri could be that nobody else than me will ever use this, but who knows, and we got better test coverage out of it ;)
01:34 perlrocks Twitter: "I started feeling guilty is Mojolicious to use and forget to make install fails with make test." (ja) --hsksyusk http://twitter.com/hsksyusk​/status/128645515918323712
01:34 GitHub174 joined #mojo
01:34 GitHub174 [mojo] kraih pushed 1 new commit to master: http://git.io/rEW6Aw
01:34 GitHub174 [mojo/master] test WebSocket ping/pong - Sebastian Riedel
01:34 GitHub174 left #mojo
01:43 sri send_message(text => $bytes); should be quite useful for JSON btw
01:44 sri since it bypasses the UTF-8 encoding step which can result in double encoded JSON
02:17 sri maybe send_message([json => {foo => 'bar'}]) would be nice in the future
02:18 sri or just send_json({foo => 'bar'})
02:18 sri (which can be a helper)
02:20 GitHub51 joined #mojo
02:20 GitHub51 [mojo] kraih pushed 1 new commit to master: http://git.io/mygfmw
02:20 GitHub51 [mojo/master] release preparations - Sebastian Riedel
02:20 GitHub51 left #mojo
02:23 perlrocks Twitter: "Mojolicious 2:10 by SRI - http://t.co/KZvqxgus" (ms) --cpan_new http://twitter.com/cpan_new​/status/128657835570630656
02:24 perlrocks Twitter: "Released #mojolicious 2.10 with some powerful new #websocket features, enjoy. :) http://t.co/itfBLz64 #perl" --kraih http://twitter.com/kraih/status/128658099518177280
02:27 sri i love events
02:57 xaka joined #mojo
03:13 preflex joined #mojo
03:21 MojoGuest828 joined #mojo
03:21 MojoGuest828 From: http://www.google.com/url?sa=t&rct=j&q​=websocket%20client%20demo&source=web&​cd=5&ved=0CDUQFjAE&url=http%3A%2F%2Fde​v.xantus.org%2F&ei=1QmmTrL_GsWBsgK0gv3gDw&​amp;usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (2 hits)
03:22 MojoGuest955 joined #mojo
03:22 MojoGuest955 From: http://www.google.com/url?sa=t&rct=j&q​=websocket%20client%20demo&source=web&​cd=5&ved=0CDUQFjAE&url=http%3A%2F%2Fde​v.xantus.org%2F&ei=1QmmTrL_GsWBsgK0gv3gDw&​amp;usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (3 hits)
03:44 rdesfo left #mojo
03:59 will joined #mojo
04:08 kaare joined #mojo
04:15 MojoGuest632 joined #mojo
04:15 MojoGuest632 From: http://blog.kraih.com/perl-is-ready-for-html5 (10 hits)
04:16 MojoGuest632 hey
04:17 sjn hello
04:27 jwang Perl 5 4 HTML 5 :)
04:27 jwang nice example
04:28 jwang I was looking at web IRC clients a while back
04:28 MojoGuest101 joined #mojo
04:28 MojoGuest101 From: http://blog.kraih.com/perl-is-ready-for-html5 (11 hits)
04:29 will left #mojo
05:01 Eugene joined #mojo
05:28 cosmincx joined #mojo
05:54 MojoGuest887 joined #mojo
05:55 MojoGuest799 joined #mojo
06:22 migo joined #mojo
06:28 Foxcool joined #mojo
06:30 Vandal joined #mojo
06:31 koban joined #mojo
06:59 batman joined #mojo
07:11 arthas joined #mojo
07:16 sugar joined #mojo
07:32 lammel2 joined #mojo
07:43 cosmincx joined #mojo
07:58 sugar joined #mojo
08:00 d4rkie joined #mojo
08:01 perlrocks Twitter: "Mojolicious 2.0, web framework for Perl http://t.co/YR1k7OLN" (es) --JacintoCorral http://twitter.com/JacintoCor​ral/status/128743092659552256
08:10 MojoGuest126 joined #mojo
08:10 MojoGuest126 From: http://news.ycombinator.com/item?id=1277067 (47 hits)
08:24 MojoGuest12 joined #mojo
08:27 perlite_ joined #mojo
08:29 MojoGuest752 joined #mojo
08:29 MojoGuest752 From: http://news.ycombinator.com/item?id=1277067 (49 hits)
08:38 mire joined #mojo
08:51 andrefs joined #mojo
08:58 dolmen joined #mojo
08:59 dolmen my mojo app is distributed as a CPAN-style package
08:59 dolmen I would like to add static files to it
09:00 dolmen and I'm thinking to use File::Share
09:00 dolmen how can I tell Mojolicious the base directory for public/ and templates/ ?
09:01 spleenjack joined #mojo
09:03 dolmen also, how can I reference the bundled JQuery from my own templates/static files ?
09:11 dolmen I found the answer to the last question: /js/query.js
09:11 dolmen /js/jquery.js
09:31 Foxcool joined #mojo
09:32 kvorg joined #mojo
09:55 Grauwolf joined #mojo
09:55 Grauwolf hi!
09:59 MojoGuest132 joined #mojo
09:59 MojoGuest132 From: http://blog.kraih.com/perl-is-ready-for-html5 (12 hits)
10:10 marty dolmen:  to set a new public directory...  $self->static->root($self->home->r​el_dir('some/static/directory'));
10:11 marty I have not tried that in a while, but it used to work.
10:12 dolmen I started to do it another way: BEGIN { $ENV{MOJO_HOME} = File::ShareDir::dist_dir('MyDist') }
10:16 MojoGuest655 joined #mojo
10:16 MojoGuest655 From: http://www.google.fi/url?sa=t&rct=j&q=​irc%20client%20with%20websockets&source=we​b&cd=2&ved=0CCQQFjAB&url=http%3A%2​F%2Fdev.xantus.org%2F&ei=IIymTt7sGcXe4QTS9​ekg&usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (1 hits)
10:16 MojoGuest605 joined #mojo
10:16 MojoGuest605 From: http://www.google.fi/url?sa=t&rct=j&q=​irc%20client%20with%20websockets&source=we​b&cd=2&ved=0CCQQFjAB&url=http%3A%2​F%2Fdev.xantus.org%2F&ei=IIymTt7sGcXe4QTS9​ekg&usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (2 hits)
10:38 MojoGuest375 joined #mojo
10:38 MojoGuest375 From: http://www.google.com.tw/url?sa=t&rct=j&​amp;q=websocket%2Bdemo&source=web&cd​=5&ved=0CFgQFjAE&url=http%3A%2F%2Fde​v.xantus.org%2F&ei=mpGmTpucJ8PImQX89tyoD​w&usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (1 hits)
10:39 MojoGuest375 zzzz
10:58 Grauwolf hm. did something change with putting arrays to stash? http://paste.geekosphere.org/kxdm
10:58 spleenjack1 joined #mojo
10:59 sugar hmm.. mb should be: "loglines    => \@logdata"
10:59 sugar '\' added
11:00 Grauwolf ah ok
11:12 bzero sri: https://gist.github.com/483682341f4d62efc479 It shows: Connected at g.pl line 25. Disconnected at g.pl line 17. Disconnected at g.pl line 17.
11:24 MojoGuest85 joined #mojo
11:24 MojoGuest85 From: http://blog.kraih.com/perl-is-ready-for-html5 (13 hits)
11:26 judofyr joined #mojo
11:27 fmerges joined #mojo
11:29 kaare joined #mojo
11:30 fmerges hi
11:31 judofyr hi
11:31 purl que tal, judofyr.
11:35 smpb_ joined #mojo
12:16 mike_ joined #mojo
12:20 dolmen sri: any plans for support of psgix.streaming (the PSGI extension for asynchronous responses) ?
12:28 tholen joined #mojo
12:30 abra joined #mojo
12:40 mattastrophe joined #mojo
12:53 sri dolmen: sure
12:54 sri psgix.streaming is rather easy to hack in, but i'm not very keen on writing the necessary tests ;)
12:55 sri and it's not like we would gain much by supporting it
12:56 dolmen it would be possible to use any AnyEvent backend, not just EV
12:57 sri that's already possible
12:58 sri https://gist.github.com/1239684 # native AE backend, written a month ago
12:59 dolmen the problem is that Mojo stays the master of the event loop, while I want my application to control it
12:59 sri that's an entirely different problem
13:00 dolmen I want to embed my webapp inside an AnyEvent application, not to embed an AnyEvent app inside Mojolicious
13:01 dolmen Twiggy is great to do that
13:02 dolmen but Mojo apps with asynchronous responses on top of Twiggy are hard
13:07 preflex joined #mojo
13:09 sri bzero: not a bug
13:29 smpb joined #mojo
13:33 Sjors hehe, I love the new exception image
13:50 GitHub161 joined #mojo
13:50 GitHub161 [mojo] kraih pushed 1 new commit to master: http://git.io/2nvo8A
13:50 GitHub161 [mojo/master] improved Mojo::IOLoop::Stream to only emit close events once - Sebastian Riedel
13:50 GitHub161 left #mojo
13:51 sri bzero: that should help though
13:57 bzero sri: Thank you!
13:58 abra joined #mojo
14:01 regueifa joined #mojo
14:02 smpb_ joined #mojo
14:02 GitHub6 joined #mojo
14:02 GitHub6 [mojo] kraih pushed 1 new commit to master: http://git.io/_BuN8A
14:02 GitHub6 [mojo/master] more precise event tests - Sebastian Riedel
14:02 GitHub6 left #mojo
14:11 sri hmm
14:12 judofyr seriously, isn't there a single Perl REPL out there that supports local history (up/down-arrows)??
14:12 * sri hates REPLs
14:12 bzero re.pl?
14:12 purl hmmm... re.pl is Devel::REPL, mst's non-broken perl REPL
14:13 sri REPLs are for languages that are bad at oneliners -.-
14:18 judofyr sri: then you haven't tried a good REPL
14:19 diegok judofyr: I use Devel::REPL with some good plugins
14:19 diegok judofyr: its nice
14:19 judofyr diegok: what plugins?
14:19 purl plugins are just multiple inheritance
14:19 diegok I learnt to love repl's after irb :)
14:20 diegok judofyr: letme past you my config.
14:21 sugar joined #mojo
14:22 diegok judofyr: https://gist.github.com/1312892
14:23 diegok judofyr: colors and tab autocompletion are my favs :)
14:23 judofyr diegok: if you're still writing Ruby code, you'll have to try pry: http://pry.github.com/
14:23 judofyr diegok: that looks pretty great
14:23 diegok judofyr: I will
14:24 diegok judofyr: thank you :)
14:29 judofyr diegok: sweet! that looks like a nice set of plugins!
14:32 diegok judofyr: yep, there are some reqs for these plugins a friend told me was hard to find, tell me if you have any problem and I'll ask him.
14:33 judofyr diegok: nah, I just had to parse some weird error messages
14:33 diegok judofyr: :)
14:34 diegok judofyr: pry looks great. Now I need a full new stdlib for ruby and I will love it :-p
14:34 diegok ^ well, and some more docs :-(
14:35 judofyr diegok: full new stdlib? not everything is crap :)
14:35 diegok judofyr: ok, just 90% new stdlib :p
14:36 metaperl joined #mojo
14:36 abra joined #mojo
14:48 perlrocks Twitter: "in perl I do not mind making your own from there WAF and Mojolicious Amon2, you also want to make mind in PHP" (ja) --memememomo http://twitter.com/memememom​o/status/128845323501191170
14:58 mire joined #mojo
14:59 marcus no idea how that translates
15:09 perlrocks Twitter: "# Mojolicious 2.0 - An interesting # # Perl web framework. http://t.co/aD059Mqn" (es) --TecNewsPeru http://twitter.com/TecNewsPe​ru/status/128850742101557249
15:10 diegok marcus: we need a real Japanese, I use to stay at those (ja) translations playing puzzle every f* day :-)
15:12 mercutioviz joined #mojo
15:14 judofyr sri: is there a plugin for timing all UserAgent-stuff?
15:14 judofyr sri: to see which external services are slow?
15:15 marcus judofyr: well volunteered!
15:15 purl you the /(wo)?man/!
15:19 sri judofyr: well volunteered!
15:19 purl you the /(wo)?man/!
15:20 marcus sri: would the new event emitter be useful for that?
15:20 judofyr sri: does EventEmitter allow me to capture start/end-events for a UserAgent?
15:20 sri yes
15:21 judofyr I need access to the Mojo::Transaction::HTTP-object though
15:21 sri start event on the ua and finish event on the tx
15:21 sri it's trivial
15:22 judofyr oh, the start-event passes the tx as a parameter
15:23 diegok judofyr: letme past again :p
15:23 diegok s/past/paste/
15:24 judofyr sri: too bad there's no way to figure out what event came from what request :/
15:24 judofyr sri: hint! hint! prove me wrong!
15:24 sri yea, how could you ever get request information for a transaction object
15:24 sri ;p
15:24 marcus subtle
15:25 judofyr sri: no, I mean the browser request
15:25 judofyr as in, the user visits /, that requests starts N other UserAgent-requests
15:25 judofyr I'd like to group those requests under the browser request
15:26 judofyr sri: maybe I can hook into some before_dispatch etc. stuff to mark what's the current request?
15:27 judofyr wait, nah, that still wouldn't work
15:28 sri sync logging for async events, i don't see that working out
15:28 diegok judofyr: https://gist.github.com/1313138
15:28 Foxcool joined #mojo
15:30 judofyr sri: good. then I'll try to prove you wrong :)
15:30 sri well, i know a way
15:31 judofyr that was quick
15:31 sri but you would have to collect timing information and log it at the end of a request
15:31 judofyr sri: example of how it would work?
15:32 diegok sri & judofyr: ^ my paste does that or I'm getting it wrong?
15:32 sri plugin defines before_dispatch hook, registers timing events, stores timing information in stash… plugin defined after_dispatch hook that logs all timing information from the stash with request information
15:32 sri diegok: the first half yes
15:33 * diegok re-reading to understand second part
15:34 sri actually after_dispatch is not the best solution
15:35 judofyr sri: it's guaranteed that before_dispatch + controller + after_dispatch will be run without interruption?
15:35 sri better use $self->tx->on(finish => sub {…}), since it happens later and will include streaming writes
15:35 sri or rather $c->on_finish(sub {…}) these days
15:36 sri judofyr: define interruption?
15:36 sri after_dispatch depends on rendering
15:36 sri so like i said, it's not ideal
15:36 sri on_finish is better
15:36 judofyr sri: no other events are called
15:36 sri which internally registers a finish event on the tx
15:37 sri judofyr: still don't get it :/
15:37 judofyr sri: if you have two requests coming it at once
15:37 judofyr oh wait
15:38 judofyr you're storing it in the stash…
15:38 sri that's not relevant
15:38 judofyr hm…
15:38 sri right
15:38 marcus \O/
15:38 judofyr but the $ua is not per-request?
15:38 judofyr that's global?
15:38 judofyr or app-global
15:38 sri that is true
15:38 sri app global
15:38 judofyr so in that case you'll have two event listeners
15:39 sri yes, you will have to check their respective controller instances
15:39 judofyr hm… how can I do that? doesn't I just get a $tx back from the event?
15:39 sri get it from the outside, and make sure you don't leak
15:40 sri just don't forget to clean up your start events on the ua once the request is done
15:41 judofyr sri: but: req1 and req2 comes in at the same time. both register a $ua->on(start => …). wouldn't all $ua-calls go to both listeners?
15:42 sri hmm
15:42 marcus async is hard, let's go shopping
15:42 * marcus goes shopping
15:42 sri right, that can't work
15:42 sri lets go shopping!
15:43 marcus I need a new pair of jeans
15:43 marcus why do they call it a pair of jeans anyways? I just need one
15:44 sri http://www.youtube.com/watch?v=ebqdwQzmSHM # so that's what norway is like
15:45 sri pretty much like i imagined it
15:45 marcus yeah, accurate
15:48 Foxcool joined #mojo
15:56 xaka joined #mojo
15:57 KayT3 joined #mojo
16:41 zenbitz joined #mojo
16:43 zenbitz does this response: 413 Request Entity Too Large  indicate that I have exceeded MOJO_MAX_MESSAGE_SIZE?
16:56 batman joined #mojo
17:02 diegok zenbitz: what are you doing? :-)
17:11 zenbitz uploading very large files
17:11 zenbitz and processing them line-by-line
17:11 zenbitz actually... I am trying to work out the best way to handle these
17:12 zenbitz probably detect if they are greater than a > length and fork a process
17:12 zenbitz and return results to the user later (cache a file on server?)
17:12 judofyr joined #mojo
17:13 zenbitz hmmm... I chagnge MOJO_MAX_MESSAGE_SIZE but it stilll stops
17:13 zenbitz after 36557 lines
17:13 zenbitz so possibly it's a browser setting...
17:14 zenbitz I am using: $data = $self->req->upload('file_data')->asset->slurp()
17:14 zenbitz but I originally had this as get_chunk() but never put it into a loop
17:16 zenbitz with chunk size ~265K
17:16 zenbitz might increase the chunk size to 1M
17:16 zenbitz I need to handle files ~3M lines long (but also smaller input)
17:20 zenbitz 36K lines takes 1156s of which ~830s is database fetches (73K)
17:24 zenbitz this is just on a mac book though.  On the server it's much faster (I think 10x the RAM)
17:29 Akron joined #mojo
17:31 GitHub97 joined #mojo
17:31 GitHub97 [mojo] kraih pushed 1 new commit to master: http://git.io/XO1JVw
17:31 GitHub97 [mojo/master] unified formatting of all experimental notes - Sebastian Riedel
17:31 GitHub97 left #mojo
17:44 sri guess i'll upload a new release later, since i want the new ioloop test cases on cpantesters
17:50 judofyr sri: so, did you solve the "map $ua requests to browser requests"-problem?
17:50 sri nope
17:51 judofyr :(
17:52 sugar joined #mojo
17:55 amoore joined #mojo
18:01 noganex_ joined #mojo
18:02 diegok zenbitz: you can inform the user about progress, I think sri has an example... but, you need to deploy you app without any proxy.
18:03 diegok zenbitz: you don't need to fork if you get right with the eventing problem...
18:13 Shaeto joined #mojo
18:35 Shaeto is unix sockets possible for IOLoop ?
18:39 Shaeto seems possible with small Client/Server modification
18:43 zenbitz diegok - thx.  I think I will break it into 3 "levels"  - just doit, progress (<=1 min), and comeback later
18:44 GitHub30 joined #mojo
18:44 GitHub30 [mojo] kraih pushed 1 new commit to master: http://git.io/IXB4WA
18:44 GitHub30 [mojo/master] unify list formatting - Sebastian Riedel
18:44 GitHub30 left #mojo
18:44 zenbitz I am still digesting NYTProf output though... some funny stuff, like it spent 19s trimming the last line if if didn't have a \n!
18:45 zenbitz can you explain further diegok: "you don't need to fork if you get right with the eventing problem..."
18:46 zenbitz I guess you mean multiple requests?
18:47 diegok zenbitz: your app runs on a event loop, you could probably write your file using some evented IO...
18:48 perlrocks Twitter: "Mojolicious 2:11 by SRI - http://t.co/lQ8Mjike" (ms) --cpan_new http://twitter.com/cpan_new​/status/128905778894606336
18:48 diegok zenbitz: you receive big files you need to process "inline" right?, or you only need to store it?
18:49 Shaeto as i understand other (not main) ioloops will work also without initial ->start ? because main event loop will handle all events ?
18:50 smpb joined #mojo
18:57 abra joined #mojo
19:02 perlrocks Twitter: "Mojolicious 2.10: The Web In A Box! http://t.co/AVgFWFpz" --lordnaastik http://twitter.com/lordnaast​ik/status/128909245398790145
19:12 gshank_ joined #mojo
19:13 zenbitz digok: basically I need to parse each line and do 1+ sqllite RTREE lookups
19:14 zenbitz Also (for large input) probably need to store the output locally for download
19:14 zenbitz otherwise just point a dynamic HTML table at it
19:16 andrefs joined #mojo
19:16 regueifa joined #mojo
19:40 andrefs joined #mojo
19:40 regueifa joined #mojo
19:46 perlrocks Twitter: "@ Tanfoglio_ test tomorrow Perl mojo: (" (nl) --jenssegers http://twitter.com/jensseger​s/status/128920499454611456
19:48 trone_ joined #mojo
19:52 Akron joined #mojo
20:16 sromanov joined #mojo
20:18 amoore joined #mojo
20:20 Akron I thought on_finish was fixed and this would work: http://irclog.perlgeek.de/​mojo/2011-10-05#i_4528488 It's not working with morbo. What am I doing wrong?
20:25 Akron sri: How about making the unicode character trailing the version number of every major release in Changes?
20:26 sri Akron: *fixed* is the wrong word
20:27 abra joined #mojo
20:27 sri we can't really guarantee that everything has been written when the finish event gets emitted
20:31 sri all we could do is guarantee that all data has been written to the kernel send buffer, but that costs up to 30% overall performance
20:32 Akron Ah, okay. So this is currently the closest I can come with this issue server independently?
20:33 sri blocking for 3 seconds always sucks anyway
20:33 sri since there will be parallel requests that are being processed
20:33 Akron Is there no way I can manually close the connection and then do some work?
20:34 sri of course
20:34 sri $self->write with drain callback
20:34 Akron I just want to do some work but don't want the client to wait for it.
20:34 sri that does guarantee that all data has been written to the kernel send buffer
20:34 Akron sri: Ah ... okay, will check.
20:35 sri also
20:35 sri the finish event has nothing to do with the connection
20:35 sri connections are reused for up to 25 keep alive requests
20:39 Shaeto yay! IOLoop server/client works in hypnotoad app :) just tested
20:39 Shaeto now i need unix sockets :)
20:43 Akron sri: :( Sorry ... I don't understand ... :( In fact I just want to do the same thing as with Mojo::IOLoop->timer(0 => sub { ... }); after I did render.
20:43 mire joined #mojo
20:43 sri no that's not what you want
20:43 Akron It's not?
20:44 sri you want a guarantee that all data has actually been written before the event gets emitted
20:44 Akron No.
20:44 sri ok, then i never understood the actual problem
20:45 Akron Well ... hm ... okay, yeah ... kind of.
20:45 Shaeto sri: if i'll inherit ::Class and add unix sockets support and put my class name it to $loop->client_class is this way correct ?
20:45 Shaeto sorry *IOLoop::Client
20:45 sri Shaeto: i do not recommend it, all those classes and attributes are experimental
20:46 sri and i guarantee some of it will break
20:46 Akron sri: Okay, after thinking about it - yeah, true. That's what I want. And on_finish is the right way to do it? Although it's not guranteed?
20:47 sri Akron: no, direct writing with drain callback is the only way to do that
20:47 sri http://mojolicio.us/perldoc/​Mojolicious/Controller#write
20:48 Shaeto sri: well i have to do, i need IPC client in the app context and only one way i see now - IOLoop, will fit it to your changes if classes will change
20:49 sri Shaeto: people always say that when i warn them, and then a few months later when stuff breaks there is a lot of whining :S
20:51 mercutioviz joined #mojo
20:51 Shaeto but you implemented ioloop client/server there for some reason :) and it works fine in main loop, will cross fingers and watch for versions :))
20:53 sri i will point you to this conversation in the channel log should you complain in the future :)
20:53 metaperl joined #mojo
20:54 sri breaking changes might not be entirely obvious though, there's a good chance it will be small things like changes in error handling, which is really hard to debug
20:55 sri actually
20:56 sri maybe it would make sense to mark some classes as INTERNAL instead of EXPERIMENTAL
20:56 sri to keep them unstable indefinitely
20:56 sri (unstable as in permit changes)
20:58 Shaeto yes
20:58 Akron sri: So this is the way: https://gist.github.com/1314239 ?
20:59 sri the return is not necessary
20:59 sri and you might want to set a content length, or it defaults to connection close
20:59 sri but otherwise, yes
21:00 Akron Ah - okay.
21:00 Akron Thank you very much!
21:07 Akron Hmm ... with a correct content length, the log is never fired https://gist.github.com/1314239 (morbo).
21:08 preflex joined #mojo
21:14 Akron sri: I still do something wrong, I think ...
21:14 Akron (The ->finish is not necessary, right?)
21:16 sri Akron: hmm
21:17 sri i see why it doesn't fire
21:17 sri and it sadly makes perfect sense
21:19 sri you can only get it to work the way you want with connection close or chunked encoding
21:20 sri or actually i'm not even sure about that
21:21 Akron Chunked encoding may be not save enough as I don't expect browsers.
21:22 Akron Why isn't it working? I am curious. ;)
21:22 sri because the drain event is high level and tied to the transaction, which is finished
21:23 Akron Can I bind something on the transaction finish event?
21:23 sri of course
21:25 sri but i think what you want to achieve is not possible at the moment
21:25 GabrielVieira joined #mojo
21:29 Eugene joined #mojo
21:33 Akron Hm. Okay. There is no render event I can hook on to do what I want? Something after the connection is closed?
21:35 sri it still has absolutely nothing to do with the connection
21:37 Akron Okay. "After the client is fine with the response"?
21:37 sri you can't know that
21:38 sri in fact, there is no way to truly know if the response has fully arrived at the client
21:38 batman joined #mojo
21:39 Akron Yeah, that's true. But with the current solution, the client always waits. I would prefer a "maybe the client has to wait" solution.
21:39 sri i don't think you really understand the problem
21:39 Akron Yes, may be true.
21:40 sri the only way to make it work kinda reliable is a Mojo::Server::Daemon patch
21:40 sri at leats as far as i can see
21:41 Akron That's part of the code I never understood. :)
21:42 sri https://github.com/kraih/mojo/commit/b6562​c9433f019dea3835b5b8726d929059c960e#L2R334
21:42 sri that change would make it work
21:43 sri but costs 30% overall performance
21:43 sri for absolutely everything
21:44 Shaeto sri: no way to add unix sockets to ioloop client.pm in future releases ?:) i can can work on this part and send diff if it can help
21:44 sri Shaeto: we had unix domain sockets in the past, but they were too much of a PITA to maintain
21:45 sri pretty much nobody used them and writing good portable tests is really really hard
21:46 sri so no, for core i don't think it makes sense
21:47 Akron sri: Oh, it was that patch. But - if I understood it right, there was a "not guaranteed but maybe" solution?
21:47 sri not that i know of
21:49 sri *but maybe* is not really something we do anyway
21:49 Akron Okay. Then I will let the client wait.
21:49 sri if it's not testable in a reliable way we most like won't do it
21:49 Shaeto sri: well, thats no problem will add tcp gateway to ipc server thanks
21:50 Akron sri: Okay.
21:50 sri Akron: feel free to play with the patch
21:50 sri i often overlook solutions
21:50 sri maybe there is one that doesn't cost as much
21:51 sri all it takes is the 8 lines from _write to be replaced
21:52 sri not even sure what exactly costs that much
21:52 sri could be useless event loop roundtrips or a parser call firing again for no reason
21:53 Akron Do you have a special test suite for testing that?
21:53 sri "that"?
21:54 Akron Overall performance.
21:54 sri that depends very much on your setup
21:55 regueifa joined #mojo
21:55 andrefs joined #mojo
21:55 sri but in this case a hello world with hypnotoad should be enough
21:55 Akron Okay.
21:56 sri Akron: http://pastie.org/2758808 # that's the hello world i use
21:56 sri it reduces high level overhead
21:57 sri and i value transfer rate higher than actual rps of course
22:10 perlrocks Twitter: "template element inheritance in mojolicious - I like! #perl" --jujav4ik http://twitter.com/jujav4ik​/status/128956719031255041
22:17 xantus[] joined #mojo
22:17 f00li5h joined #mojo
22:18 andrefs joined #mojo
22:21 sri Akron: actually, i don't think it matters really
22:21 sri once you have multiple parallel requests the drain event would fire while some other request is still writing
22:21 sri which would then loch that one down for 3 seconds
22:21 sri *lock
22:22 sri blocking is always bad
22:23 sri the only way i see is to split up that blocking task into smaller chunks
22:23 sri and use Mojo::IOLoop->defer(sub {…}) repeatedly
22:24 sri of course this is not a good solution either (just a working one)
22:24 sri the good solution is to use a separate process
22:25 sri you could also gamble and set a 1s timer or so ;p
22:30 Akron I tried it with the timer and it didn't work as expected with psgi. I wanted to have a easy and portable solution, as it is part of a plugin - so better no gambling and no magic. :)
22:31 sri now that will be really hard
22:32 mire joined #mojo
22:37 smpb joined #mojo
22:38 Akron Hm.
23:11 xantus[] I'm wondering if you can specify a src address when making a client connection
23:20 sri no you can't
23:27 zenbitz where is a good place to read up on event handing in Mojo?
23:28 sri there are no tutorials or introductions yet, events only have reference documentation in their respective classes and are used extensively in unit tests
23:29 sri so far it's only for really advanced users
23:30 zenbitz just trying to figure out what to do with diegoks advice:
23:30 zenbitz zenbitz: your app runs on a event loop, you could probably write your file using some evented IO...
23:32 zenbitz yipe, gotta run
23:49 sri too bad Akron vanished
23:49 sri i might have a way for him to make it work
23:53 sri http://pastie.org/2759276 # here's a messy patch that makes it work without losing any performance
23:53 sri it needs to be cleaned up and extended with tests though
23:54 sri which i'm not very motivated to do
23:58 sri oh
23:58 sri http://pastie.org/2759295 # much shorter version

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