Camelia, the Perl 6 bug

IRC log for #mojo, 2011-11-14

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

All times shown according to UTC.

Time Nick Message
00:00 tm yes, this is great
00:00 tm btw https://github.com/kraih/mojo/wiki/Using-Redis says 'under sub {' ... what is the meaning of 'under'?
00:01 SmokeMachine joined #mojo
00:30 tm can anybody point me towards solution that would keep track of Redis and reconnect if connection drops/times out? timout 0 in redis is not an answer - sometimes link may fail or redis get restarted :-/
00:31 tm the equivalen of $redis->ping says 'can't read from socket' - no surprise if redis was for example restarted
00:39 andrefs joined #mojo
00:51 andrefs joined #mojo
01:01 driller_work joined #mojo
01:16 metaperl joined #mojo
01:37 Alias joined #mojo
01:39 Alias left #mojo
03:06 Eugene joined #mojo
04:11 arpadszasz joined #mojo
04:52 MojoGuest54 joined #mojo
04:52 MojoGuest54 From: http://www.google.com/url?sa=t&rct=j&​q=&esrc=s&source=web&cd=4&sqi​=2&ved=0CDYQFjAD&url=http%3A%2F%2Fdev​.xantus.org%2F&ei=rZzATofTKeGO0gGhpNXYBA&​amp;usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (1 hits)
04:52 MojoGuest88 joined #mojo
04:52 MojoGuest88 From: http://www.reddit.com/r/html​5/comments/bt76k/irc_client/ (4 hits)
04:54 MojoGuest223 joined #mojo
04:54 MojoGuest223 From: http://blog.kraih.com/perl-is-ready-for-html5 (25 hits)
05:50 alnewkirk joined #mojo
05:55 Vandal joined #mojo
06:39 abra joined #mojo
06:49 koban joined #mojo
07:04 Eugene joined #mojo
07:07 alnewkirk joined #mojo
07:24 sugar joined #mojo
08:15 cosmincx joined #mojo
08:29 berov joined #mojo
08:30 Foxcool joined #mojo
09:10 berov Hello to all. I was looking for a tutorial covering hooks in Mojolicious. Can somewone point me to an url?
09:13 spleenjack joined #mojo
09:21 alnewkirk berov, http://mojolicio.us
09:22 berov alnewkirk, http://perlbuzz.com/2011/1​1/mjd-on-giving-fish.html
09:23 berov expected something more specific , thanks
09:23 alnewkirk berov, whyh the link
09:24 berov alnewkirk, I was sking for a url on hooks
09:25 berov I know mojolicious
09:25 alnewkirk no, I asked why you point me to that link?
09:25 alnewkirk what is it?
09:25 purl it's it!
09:26 berov alnewkirk, :) to tell you that you are not helping me
09:26 alnewkirk ohhhhh, i got cha
09:26 berov alnewkirk, this is my answer
09:26 berov :)
09:26 alnewkirk lemme read
09:26 berov sure :)
09:27 alnewkirk I read the first paragraph and i'm over it
09:27 alnewkirk foh
09:27 berov ok
09:28 alnewkirk I'm teaching you to fish, ... go to the website where the author took the time to prepare all the documentation you seek
09:28 tempire berov: http://mojolicio.us/perldoc/Mojolicious#hook
09:28 berov that is obviously not enogh
09:28 alnewkirk now apply these teachings (on how to find shit) and be extra proficient in the future
09:28 alnewkirk also
09:29 alnewkirk google, site:mojolicio.us hook
09:29 tempire the descriptions on those hooks are pretty good at describing what they all do
09:29 tempire don't know of any blogs/tutorials past those on hooks, since they're not something beginners usually mess with.
09:29 berov ok but agree
09:30 berov i want to create a hook
09:30 berov and then use it
09:30 berov my own hook
09:30 berov not sure I am abeginner anyway
09:30 tempire it's doubtful you want to create a hook
09:31 berov beleive me I do want
09:31 stephan48 /archieve
09:31 stephan48 /archive
09:31 purl step back. explain what you're trying to archive.
09:31 tempire then you'll have to dive into the source
09:31 tempire though I would bet you want to subscribe to an existing event instead.
09:31 berov I want to make a hook then use it to execute some code
09:32 stephan48 please follow purls advice, and explain what you want, and why
09:32 berov imagine an application
09:32 alnewkirk also, imho, rtfm is often apropo because some things can't (or are significantly harder) to understand *out-of-context*
09:32 * stephan48 imagines an application
09:33 berov to which some plugins are added
09:33 alnewkirk e.g. Plack middlewares, POE wheels, yada yada
09:33 berov theese plugins want to do something when something happens (business logic)
09:34 berov so i need to be able to execute some code at arbitrary place
09:34 berov put my newly created hook and call it- not sure what the word for it is
09:34 tempire hooks only apply when trying to do something at a known place.
09:35 berov emit?
09:35 purl emit is to radiate.
09:35 berov yep
09:35 tempire you probably want events.
09:35 berov ah ok let it be events
09:35 berov thanks
09:35 berov there is a place in the framework itsel
09:35 berov wait...
09:35 tempire everything in mojolicious is an event
09:36 tempire even stephan48's imagined application.
09:36 alnewkirk depending on whether you have a Mojolicious or ::Lite app its different
09:37 berov https://github.com/kraih/mojo/blob/master/​lib/Mojolicious/Plugin/PODRenderer.pm#L118
09:37 berov no not Lite
09:37 alnewkirk also, #mojolicious exists
09:38 berov alnewkirk, ok should I sak my question there?
09:38 alnewkirk sri isn't friendliest critter
09:38 alnewkirk try at your own peril
09:39 berov alnewkirk, ok thanks
09:43 alnewkirk np
09:45 alnewkirk wait, wtf? I thought I was in the perl channel. Did I just recommend a non-existent channel ... #fail .. sorry
09:47 berov yep you did :)
09:48 berov ook this is my context https://github.com/kberov/MYDLjE
09:48 stephan48 oh!
09:48 stephan48 thanks for writing it... it inspired me for some of my applications
09:49 berov I want to create a "validate" hook ort event
09:49 berov what would be the best way
09:49 berov wellcome
09:50 berov will be back in 10 minutes
10:06 migo joined #mojo
10:07 Shaeto joined #mojo
10:10 d4rkie joined #mojo
10:10 berov about validation hook/event...
10:11 berov I would like for example to take out all the validation code out of here: https://github.com/kberov/MYDLjE/blob/master​/perl/lib/MYDLjE/ControlPanel/C/Site.pm#L61
10:11 berov and just emit(?) the validation hook/event
10:14 crab interesting.
10:14 crab wouldn't you have to break things up a lot more to be able to organise your code that way?
10:15 crab something to create the validator and feed it stuff, another to subscribe to the event, etc.
10:18 berov not sure I understand the question "wouldn't you have to break things up a lot more to be able to organise your code that way?"
10:18 berov ah actually it may be done
10:20 berov btw anyone is wellcome to help make this app a reference for Mojolicious usage. i definitely need inspiration and help
10:22 berov I am doing it in my free time at nights but it can become a "real usage example"
10:33 Foxcool joined #mojo
10:33 * crab ponders
10:33 crab berov: what problem are you trying to solve?
10:35 MojoGuest399 joined #mojo
10:35 MojoGuest399 From: http://www.google.de/url?sa=t&rct=j&q=i​rc%20extjs%20client&source=web&cd=1&amp​;ved=0CCAQFjAA&url=http%3A%2F%2Fdev.xantus.​org%2F&ei=zu7AToHsE-Wg4gTshuyRBA&usg=AF​QjCNGw6nZv0wO42uzUnHhWcD0vcKNULg&cad=rja (1 hits)
10:35 MojoGuest273 joined #mojo
10:35 MojoGuest273 From: http://www.google.de/url?sa=t&rct=j&q=i​rc%20extjs%20client&source=web&cd=1&amp​;ved=0CCAQFjAA&url=http%3A%2F%2Fdev.xantus.​org%2F&ei=zu7AToHsE-Wg4gTshuyRBA&usg=AF​QjCNGw6nZv0wO42uzUnHhWcD0vcKNULg&cad=rja (2 hits)
10:36 MojoGuest947 joined #mojo
10:36 MojoGuest947 From: http://www.google.de/url?sa=t&rct=j&q=i​rc%20extjs%20client&source=web&cd=1&amp​;ved=0CCAQFjAA&url=http%3A%2F%2Fdev.xantus.​org%2F&ei=zu7AToHsE-Wg4gTshuyRBA&usg=AF​QjCNGw6nZv0wO42uzUnHhWcD0vcKNULg&cad=rja (3 hits)
10:37 MojoGuest899 joined #mojo
10:37 MojoGuest899 From: http://www.google.de/url?sa=t&rct=j&q=i​rc%20extjs%20client&source=web&cd=1&amp​;ved=0CCAQFjAA&url=http%3A%2F%2Fdev.xantus.​org%2F&ei=zu7AToHsE-Wg4gTshuyRBA&usg=AF​QjCNGw6nZv0wO42uzUnHhWcD0vcKNULg&cad=rja (4 hits)
10:37 MojoGuest383 joined #mojo
10:37 MojoGuest383 From: http://www.google.de/url?sa=t&rct=j&q=i​rc%20extjs%20client&source=web&cd=1&amp​;ved=0CCAQFjAA&url=http%3A%2F%2Fdev.xantus.​org%2F&ei=zu7AToHsE-Wg4gTshuyRBA&usg=AF​QjCNGw6nZv0wO42uzUnHhWcD0vcKNULg&cad=rja (5 hits)
10:49 cosmincx joined #mojo
10:51 MojoGuest43 joined #mojo
10:51 MojoGuest43 From: http://www.google.de/url?sa=t&rct=j&q=i​rc%20extjs%20client&source=web&cd=1&amp​;ved=0CCAQFjAA&url=http%3A%2F%2Fdev.xantus.​org%2F&ei=zu7AToHsE-Wg4gTshuyRBA&usg=AF​QjCNGw6nZv0wO42uzUnHhWcD0vcKNULg&cad=rja (6 hits)
10:51 MojoGuest308 joined #mojo
10:51 MojoGuest308 From: http://www.google.de/url?sa=t&rct=j&q=i​rc%20extjs%20client&source=web&cd=1&amp​;ved=0CCAQFjAA&url=http%3A%2F%2Fdev.xantus.​org%2F&ei=zu7AToHsE-Wg4gTshuyRBA&usg=AF​QjCNGw6nZv0wO42uzUnHhWcD0vcKNULg&cad=rja (7 hits)
10:54 crab yikes.
10:55 spleenjack joined #mojo
10:56 berov what are these urls iVisited them.... but.....  how rude :)!
10:59 berov crab, i want to create a "hook/event" miniframework for my application mydlje so people are able to extend it effectively
10:59 berov it should be based on the Mojolicious hook/event paradigm
11:01 berov there is already the Mojolicious::Plugin::* way but I want people to hook into MYDLjE too
11:06 abra joined #mojo
11:19 MojoGuest597 joined #mojo
11:19 MojoGuest597 From: http://www.google.de/url?sa=t&rct=j&q=i​rc%20extjs%20client&source=web&cd=1&amp​;ved=0CCAQFjAA&url=http%3A%2F%2Fdev.xantus.​org%2F&ei=zu7AToHsE-Wg4gTshuyRBA&usg=AF​QjCNGw6nZv0wO42uzUnHhWcD0vcKNULg&cad=rja (8 hits)
11:19 crab hmm, i don't think a controller can be an eventemitter
11:21 Akron joined #mojo
11:23 Akron berov: Hooks are pretty simple, just emit  $c->app->plugins->emit_hook('hook_name' => @parameters) anywhere in your plugin or app and hook on it elsewhere.
11:24 Akron I use it to pass references to the hook, for example to prepare a document to render, and by using the hook, plugins can modify the content.
11:36 Akron berov: https://github.com/kraih/mojo/wik​i/Creating-new-plugins#wiki-Hooks Just for you! :)
11:46 migo_ joined #mojo
11:48 batman left #mojo
11:48 batman joined #mojo
12:05 * sri yawns
12:11 Psyche^ joined #mojo
12:14 yko joined #mojo
12:18 berov Wowwwww, Thanks so much, this is waht I needed, i knew it is simple!
12:18 berov Thanks, Akron
12:25 sri alnewkirk: i'm only unfriendly to people who warn others about me being unfriendly
12:27 marcus sri: temper temper...
12:27 marcus ;-)
12:28 * sri is absolutely calm ;p
13:01 sri i'm going to deprecate a few more Mojo::IOLoop methods
13:02 sri ->connection_timeout will become just ->timeout
13:02 noganex joined #mojo
13:07 sri http://pastie.org/2861482 # here's what i have in mind for the final Mojo::IOLoop API
13:21 d4rkie joined #mojo
13:22 Shaeto left #mojo
13:25 sri also adding and using a new write event in Mojo::IOLoop::Stream
13:26 sri for debugging you'll be able to see absolutely everything that goes over the wire in the future just by using the read/write events
13:31 andrefs joined #mojo
13:37 berov sri, does this affect somehow high level usage of mojolisious like in a CMS?
13:37 sri no
13:37 berov thanks
13:41 sri or actually, it might make things a little faster :)
13:42 elb0w_ so an IOLoop is just a tcp connection that waits for data otherwise it keeps iterating?
13:42 elb0w_ well not waits
13:43 elb0w_ loops until it has data so it can do other things that the data is not required for
13:43 sri no, it's an event reactor
13:43 elb0w_ so does it block?
13:43 sri yes
13:43 elb0w_ only for the timer no?
13:44 elb0w_ This is a concept I need to understand better
13:44 elb0w_ When I think reactor I just think of a loop constantly running and doing checks
13:45 sri that pretty much sums it up
13:46 sri IOLoop does not loop itself though, it uses pluggable backends like EV to do the looping and watching
13:46 elb0w_ ah ok
13:46 elb0w_ So its a layer ontop of that then
13:46 sri it's a convenience layer
13:46 elb0w_ gotcha thanks for explaining
13:46 sri it reacts to events a lower level event watcher emits
13:49 elb0w_ ok cool
13:57 baton8 joined #mojo
13:59 sri hmm
13:59 sri think i like "my ($loop, $stream, $error) = @_;" more than "my ($loop, $error, $stream) = @_;"
13:59 sri especially in combination with "my ($loop, $stream, $id) = @_;" for ->server
14:01 sri http://pastie.org/2861724 # $stream first or $id/$error?
14:06 Patterner $stream as 2nd arg
14:06 jnap joined #mojo
14:07 * sri nods
14:08 Patterner using dummy args and always have "my ($loop, $stream, $id, $error) = @_;" for both is ugly, right?
14:09 sri very ugly
14:10 sri $stream and $error are already exclusive, only one can be defined at any given time :S
14:10 sri but i can't think of a cleaner way to handle connect errors
14:12 * Patterner has to read up on stream documentation…
14:13 arpadszasz joined #mojo
14:13 baton8 joined #mojo
14:31 geira joined #mojo
14:35 tempire HEY GUESS WHAT DAY IT IS!!!!?!?!
14:36 tempire hmm.  no one is guessing.  maybe I didn't use enough exclamation points.
14:37 marcus tempire: your birthday_
14:37 marcus ?
14:37 tempire no, that passed a week ago.
14:37 marcus your death day?
14:37 tempire no one got me a present by the way.  I'm not bitter, though.   NOT AT ALL.
14:37 tempire It's mojocast monday!!
14:37 marcus presents are overrated
14:38 tempire \o
14:38 tempire o/
14:38 tempire \o/
14:38 marcus (Y)
14:41 tempire perlrocks is dead.
14:53 sri \o/
14:54 sri yes, perlrocks stopped working, and i didn't have time to fix it
14:54 sri so it's gone for good now
14:55 sri unless someone feels like rewriting it sanely
15:03 koban left #mojo
15:17 tempire I'm tempted to saturate my mojocast blogpost with fun fun fun fun fun
15:17 tempire but I think I'll resist
15:20 sri :)
15:21 sri should be interesting to see how the number of viewers will be affected by less agressive marketing
15:29 anparker мне там рисовка нравится)
15:29 anparker sorry
15:30 tempire you're not trying to keep mojolicious events under wraps, are you?
15:30 sri please elaborate
15:30 tempire can I mention it in a blog post?
15:31 sri sure
15:31 elb0w_ sri: did you look into bing?
15:31 sri events aren't going anywhere
15:31 sri some might change a little but that's it
15:31 sri elb0w_: no
15:35 metaperl joined #mojo
15:38 tempire would you call mojo completely event driven?
15:44 driller_work joined #mojo
15:45 marty tempire++   Another Excellent Mojocast!   \o/
15:45 tempire \o/
15:46 kaare joined #mojo
15:54 sri tempire: not sure i would say completely
15:54 tempire ok.  I figured, so I changed wording.
15:57 mercutioviz joined #mojo
15:58 marcus utterly!
16:14 MojoGuest777 joined #mojo
16:14 MojoGuest777 From: http://www.google.com.vn/url?sa=t&rct=j&​amp;q=extjs%20demo&source=web&cd=9&a​mp;ved=0CFgQFjAI&url=http%3A%2F%2Fdev.xa​ntus.org%2F&ei=fT3BTsTSOqGSiQfDncWLBQ&am​p;usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (1 hits)
16:29 Sjors hmm, how does this feature work exactly?
16:29 Sjors http://mojolicio.us/perldo​c/Mojolicious/Routes#under
16:29 Sjors it points at Mojolicious::Lite, where one can say under sub { this code is executed before every other route handler after this one }
16:30 Sjors but in my Mojolicious (not Lite) application I wrote $r->under(sub { warn "Foo bar baz" }); and don't get any output, meaning it's not being called at all
16:30 Sjors is this a bug, or something I missed from the documentation?
16:31 stephan48 please use bridge under Mojolicious
16:33 metaperl|2 joined #mojo
16:33 Sjors stephan48: so, if I understand the documentation correctly, I have to do something like $r->bridge('/', sub { this code will always be executed }) ?
16:33 Sjors stephan48: or will it only be executed for / ?
16:57 tempire Sjors: http://pastie.org/2862550
16:57 tempire ack
16:58 tempire ignore that
16:58 tempire ok, Sjors: https://gist.github.com/1364438
16:58 alnewkirk joined #mojo
16:59 tempire the bridge code will be executed whenever the /protected route gets matched
16:59 tempire and it will process /protected only if root#auth returns true
17:04 marcus http://www.mrspeaker.net/2011/11/1​4/coffeescript-less-with-play-2-0/ play 2.0 seems neat
17:08 sugar joined #mojo
17:23 marcus Sri: I told stevan you are doing mongodb drivers. He promised to nag you about it ;-)
17:24 sri :S
17:26 marcus He was considering paying rafl to do better ones, and not give them to mongo :-)
17:33 mire joined #mojo
17:43 mojimbo joined #mojo
17:45 sri marcus: didn't you want better MOJO_USERAGENT_DEBUG=1 output?
17:46 sri next release you can build that yourself with new events
17:48 elb0w_ What db backend to people normally use with mojo?
17:57 Sjors tempire: ah, awesome!
18:01 mire joined #mojo
18:02 marty elb0w_: Mongodb is popular but there are lots of uses of other DB
18:40 grim_fandango joined #mojo
18:43 Sjors tempire: so I had this:
18:43 Sjors my $r = $self->routes;
18:43 Sjors $r->get(....) and $r->any(...) etc
18:43 Sjors changed it to this:
18:44 Sjors my $r = $self->routes->bridge(sub { warn "foo"; return 1; });
18:44 Sjors tempire: from your code, that should mean that the sub should run, and then all other routes, right?
18:46 Sjors tempire: all my pages now render the "not found" page, for some reason
18:46 MojoGuest800 joined #mojo
18:46 MojoGuest800 From: http://news.ycombinator.com/item?id=1277067 (103 hits)
18:46 MojoGuest800 left #mojo
18:53 Sjors tempire: when I give bridge() two parameters, e.g. bridge(undef, sub {}) or bridge('/', sub {}), the original paths work again but the sub is still not executed
19:05 Sjors tempire: so some code that looks like this:
19:05 Sjors ˙       $r->get('/public', sub { warn "PUBLIC"; return shift->render_text("PUBLIC!") });
19:05 Sjors ˙       my $auth = $r->bridge(undef, sub { warn "BRIDGE"; return 1; });
19:05 Sjors ˙       $auth->get('/protected', sub { warn "PROTECTED", return shift->render_text("PROTECTED!") });
19:06 Sjors tempire: but the subroutine isn't executed, while I did expect it to
19:06 sri please do not paste into the channel
19:07 Sjors sorry
19:07 Sjors any ideas?
19:08 Quai joined #mojo
19:08 andrefs joined #mojo
19:32 SmokeMachine joined #mojo
19:39 elb0w_ marty: but theres no mongodb yet i thought until sri is done
19:40 marty elb0w_: http://search.cpan.org/dist/Mojolicious-Plug​in-Mongodb/lib/Mojolicious/Plugin/Mongodb.pm
19:41 elb0w_ marty: what is sri writing then?
19:41 elb0w_ oh this will block
19:41 elb0w_ i guess sri's will not?
19:42 elb0w_ yo!
19:42 elb0w_ er
19:42 marcus yeah, this is just a wrapper around the crappy original drivers.
19:43 marty Only sri knows.  But I am assuming it will be an optimized mongodb driver for mojolicious  (just a guess)
19:43 elb0w_ what would happen if you forked at a request?
19:43 elb0w_ I guess bad things?
19:43 aptituz Sjors: AFAICT your bridge misses something like a ->to(), i have something like $bridge = $r->bridge()->to( cb => sub { }) and this works for all routes defined via $bridge->(get|post|any)
19:43 marty And it required anymoose if I recall.
19:44 elb0w_ ie any request would fork off serve it and exit
19:44 elb0w_ wouldnt that sort of solve blocking issue assuming it makes its own db connection
19:45 elb0w_ or not nvm
19:45 elb0w_ haha
19:45 SmokeMachine joined #mojo
19:45 elb0w_ speed of words not equal to speed of thought
19:46 marcus Mojo::IOLoop::Fork::You
19:50 smpb joined #mojo
19:58 Sjors aptituz: aahhh cb => sub {}
19:58 Sjors aptituz: right! thanks
19:58 Sjors "callback"
19:59 aptituz Sjors: note the ->to like in normal routes
20:03 Sjors aptituz: yeah, but until now, I've defined normal routes that used subroutines using ->get('foo' => sub {})
20:03 Sjors aptituz: ->to( cb => sub{}) makes a lot of sense, thanks a lot
20:06 aptituz Sjors: ah, i didn't even know that ->get('foo' => sub {}) work, probably because I never did cb-dispatching except for the bridge (and even their I changed to a dedicated controller action)
20:43 baton8 joined #mojo
20:44 SmokeMachine joined #mojo
21:12 trone joined #mojo
21:15 Nickeeh joined #mojo
21:16 Nickeeh Does anyone have some experience with write_chunk and how it works? I can't figure it out, it seems to "buffer" the chunks, which is not what I want.
21:17 Nickeeh The "buffering" i'm refering to is such as it doesn't write to the socket on every write_chunk, only every once in a while.
21:24 Akron joined #mojo
21:24 Akron tempire++ Great Mojocast!
21:29 SmokeMachine joined #mojo
21:44 abra joined #mojo
21:51 berov joined #mojo
21:53 berov left #mojo
21:54 berov joined #mojo
21:57 berov left #mojo
21:57 Nickeeh I figured out that by calling IO::_one_tick() it flushes the buffer more often, but this is probably not the best way to do it. What's the right way to "force" a tick, so that it'll write it's buffered data?
21:57 Nickeeh *its
21:58 gshank joined #mojo
21:59 sri Nickeeh: don't!
22:01 sri in newer mojolicious releases we actually prevent one_tick from working that way
22:02 sri (it will die)
22:02 sri to sum it up, you can't flush the write buffer, and that's by design
22:03 sri your only option is to use a drain callback
22:06 Nickeeh sri: Is that the same callback as in write_chunk()? Because that's the one we already use...
22:06 abra joined #mojo
22:06 sri it is
22:07 Nickeeh sri: then what am I doing wrong? It doesn't flush often enough. :(
22:07 Nickeeh And I can't get it to flush more often.
22:08 sri sounds like you have a different problem, because the ioloop will always flush as soon as it can
22:09 Nickeeh sri: hmm, what makes it know it "can" write?
22:09 sri a writable event watcher on the file descriptor
22:10 Nickeeh sri: but when I call _one_tick(), sorry for that ;-), it *does* write immediately. So it can already write, right?
22:11 sri that's not relevant
22:11 Nickeeh When does that event happen for instance? Should it happen after every write_chunk()?
22:12 sri no, it will happen when the event loop allows it to happen
22:12 sri that's beyond your control
22:12 sri (for good reason obviously ;p)
22:13 sri your one_tick call will make it write faster for a very short amount of time, then the process will die
22:13 Nickeeh sri: my drain callback immediately calls the next write_chunk(), and it's also immediately called after the drain event, but the data doesn't appear on the socket right away, unless _one_tick() is called. I checked it in telnet... :/
22:14 Nickeeh sri: haha, yeah, that's not what I intend to do.
22:14 Nickeeh Hmpf.
22:14 sri evented io is hard, lets go shopping!
22:15 Nickeeh I can't shop without the money. No website, no money. :( Better understand evented io, heh.
22:23 Nickeeh Normally, between putting data in the send buffer and the drain event happening, the data is put on the socket, but somehow my drain callback is called without the data appearing on my socket. Does the writable-event not happen? Why is drain called then? Or am I misunderstanding something else completely? What else could I be doing wrong?
22:24 sri first of all, get a recent version of mojolicious
22:24 Nickeeh Will do! :)
22:24 sri drain timing was fixed recently
22:25 sri you may very well just be fighting with a bug there
22:25 abra joined #mojo
22:25 sri (still can't flush, but timing of writes should be right)
22:26 Nickeeh Mmkay, it'd be great if that actually turns out to be it to be honest, heh.
22:29 sri pretty sure it is, since i'm working on new low level events to watch what goes over the wire right now
22:31 Nickeeh I updated it to 2.26, but the same behavior keeps happening. I'm testing it with a simple example: write a header, and then some counter. In telnet I expect to see smoothly increasing counter, but instead I get 2, 6, 14, 30, 62, 126, and then the rest. Note it doubles? Weird right? I don't get why it does that..
22:32 Nickeeh I could write a testcase if you like?
22:36 andrefs joined #mojo
22:39 Nickeeh sri: here's the testcase if you're interested: https://gist.github.com/fac672eb7bc967b779da For in a standard generated mojo app, then run ./script/testcase get '/'
22:39 Nickeeh The pattern outputted here is 1, 3, 7, 15, 31... do you also get this result?
22:43 berov joined #mojo
22:56 sri Nickeeh: think there is another bug on higher level, i'll fix it later
22:56 sri *+a
22:56 Nickeeh sri: hmm, okay. Thanks for looking at it. :)
22:57 sri guess the high level drain event just needs to be synced with the low level ones or so… should be trivial
22:58 Nickeeh sri: in the meanwhile, a verrry dirty workaround would be tooo... ?
22:58 Nickeeh (or less dirty, doesn't have to be dirty)
22:58 sri there is no workaround
22:59 Nickeeh </3
22:59 Nickeeh k, thanks.
23:04 metaperl joined #mojo
23:08 tempire there was a list somewhere on metacpan showing the popularity of each module
23:15 Nickeeh sri: in case you're interested: the time between the calls to _one_tick() seems to increase. ON_WRITABLE is set everytime tick is called, so that doesn't seem to be the problem.
23:15 Nickeeh The time seems to double.
23:17 sri tempire: yea, not paying attention to it anymore since i've found out how easy cheating is
23:17 sri you can upvote with as many throwaway accounts from twitter/facebook/github as you want
23:23 sri +1 systems where you can't look at the people upvoting are pretty stupid
23:50 berov joined #mojo

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