Camelia, the Perl 6 bug

IRC log for #mojo, 2011-10-10

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

All times shown according to UTC.

Time Nick Message
00:25 l3l1p joined #mojo
00:28 perlrocks Twitter: "Mojolicious 1.99 Chota not want to take tests% (cut into vebsoketah" (ru) --Spear5030 http://twitter.com/Spear503​0/status/123193031124979713
00:37 j3nnn1 joined #mojo
01:10 diegok sri: https://gist.github.com/1274441
01:14 diegok ^ should I do that different?
01:15 sri diegok: don't think that would work with multipart responses
01:16 sri but as long as you're aware of that, not the worst solution
01:17 sri you could also get in trouble with huge files
01:20 sri to do it properly we would need another callback
01:20 diegok sri: interesting...
01:20 sri between chunked preprocessing and the normal content parser
01:21 sri i'm not too keen on adding more callbacks atm though
01:21 sri been thinking about replacing them all with events
01:22 diegok my ua doesn't need any of these, but I would like to give it a try. Can this be packaged into something easy to plug onto UA?
01:22 diegok sri: I can wait on this :)
01:22 diegok this hack is doing his work ATM.
01:23 sri well, my events idea is a little unrealistic at this point, since backwards compatibility would be pretty much impossible
01:23 sri http://mojolicio.us/perldo​c/Mojo/IOLoop/EventEmitter
01:23 diegok hm... for mojo 3.0? :-p
01:23 sri that's what i use on the lower layers
01:23 sri node.js-ish
01:24 diegok i see :)
01:26 diegok like the once() subscription...
01:33 diegok sri: why might be troubles with huge files?
01:35 sri diegok: because you're slurping everything into memory
01:36 diegok sri: ok, nothing fancy :-p
01:46 diegok sri: when a huge body is received, is buffered on disk?
01:48 sri diegok: yes
01:48 diegok is there a fh i can read from?
01:50 sri of course
01:53 diegok so, big files is fixable :)
01:55 sri big files also worked in your previous version, as long as you have the necessary memory
02:28 GitHub184 joined #mojo
02:28 GitHub184 [mojo] kraih pushed 1 new commit to master: http://git.io/QXExKg
02:28 GitHub184 [mojo/master] added experimental auto_upgrade attribute to Mojo::Content::Single - Sebastian Riedel
02:28 GitHub184 left #mojo
02:29 sri that should help with content filtering hacks in the future
02:29 sri since automatic multipart parsing is not desirable in such situations i guess
02:32 sri basically, just set $tx->res->content->auto_upgrade(0) and content won't be processed further
02:50 crab good morning
02:50 purl For you maybe.
03:25 GitHub117 joined #mojo
03:25 GitHub117 [mojo] kraih pushed 1 new commit to master: http://git.io/aSHBlw
03:25 GitHub117 [mojo/master] added experimental boundary method to Mojo::Content - Sebastian Riedel
03:25 GitHub117 left #mojo
03:25 * sri waves
03:53 sri the idea of making the user agent easier to extend is tempting, but i'm not sure we're ready for it yet
03:54 sri making it a subclass eventemitter which would allow $ua->on(start => sub {…}); and adding some automatic loading mechanism (->plugin('FooBar')) would prolly be enough for a many cases
03:56 sri then again, that could also be done on a higher level as a subclass
03:57 sri a user agent framework
04:19 tempire joined #mojo
04:24 tempire joined #mojo
04:59 l3l1p joined #mojo
05:08 perlite_ joined #mojo
05:21 koban joined #mojo
05:35 batman joined #mojo
05:35 noganex joined #mojo
05:38 smpb joined #mojo
05:42 l3l1p joined #mojo
05:54 smpb joined #mojo
06:06 sromanov joined #mojo
06:39 batman joined #mojo
07:04 sri hmm
07:04 sri i kinda like the idea of replacing all callbacks with events
07:05 sri stuff like $tx->on_request->($tx) would become $tx->emit('request')
07:23 crab purly internal change, really?
07:23 crab purely
07:23 sri ye
07:23 sri unless someone depends on it really being callbacks
07:24 sri of course it can't have 100% the same semantics, but it doesn't break any tests
07:24 sri (none that aren't new in 2.0 ;p)
07:26 crab what would it be but not a callback?
07:27 crab s/not//
07:27 sri $tx->on_request->($tx) for example couldn't work anymore
07:28 sri since of course there are multiple callbacks behind the event now
07:28 crab ah
07:28 sri $tx->on_request(sub {…}) still works
07:28 sri but instead of setting an accessor it registers an event
07:29 sri and there can be many as you'd like
07:29 sri it's rather cool for websockets
07:30 sri since multiple client connections for example could subscribe to message events from one backend connection
07:30 crab nice
07:30 sri or http streams, multiple subscriptions to incoming chunks of data
07:31 sri or user agent plugins
07:31 sri you can subscribe to start events now and decorate transactions
07:32 sri which in turn offer new events
07:32 sri $tx->on(finish => sub {…})
07:33 sri it also doesn't affect too many classes
07:34 sri useragent, message, content, transaction and server
07:36 batman hi
07:37 batman where can i read about websockets? i would like to know more about what can be transmitted and how big the messages can be
07:40 sri the spec
07:40 purl rumour has it the spec is broken rather than the RTF
07:41 batman ok. so there's no "ws for dummies" paper i can get started on?
07:41 sri nope, the stable spec is just a few days old
07:41 batman ok. thanks
07:41 cosmincx joined #mojo
07:41 sugar joined #mojo
07:44 Vandal joined #mojo
07:58 MojoGuest543 joined #mojo
07:58 MojoGuest543 From: http://www.google.com/url?sa=D&amp​;q=http://dev.xantus.org&usg=A​FQjCNF_rM6vpg9DT3eh4McOgWqn8mn5Xw (1 hits)
08:04 smpb joined #mojo
08:25 perlrocks Twitter: "MCPC: Mojolicious:: Lite is to move together and put AnyEvent EV ...: In short, MCPC: Mojolicious on Google Chrome Web Browser:: Lit ... http://t.co/8eiGS9bx" (ja) --chrome_jp http://twitter.com/chrome_j​p/status/123313111510941696
08:36 diegok sri: so, 2.0 will add events support and wrap on_*($setters) to subscribe to the events?
08:36 sri diegok: not sure yet
08:37 sri it's a lot of fun to use though
08:37 diegok sri: yes!, I really like the idea :)
08:38 diegok sri: only problem is if someone is manually calling cb, right?
08:38 sri yes
08:39 sri i'll also have to profile it and make sure it doesn't ruin performance
08:39 spleenjack joined #mojo
08:39 diegok sri: ok, thats important :)
08:39 sri direct cb access is untested though, so it doesn't really qualify as a features ;p
08:40 diegok I can't imagine why to call it manually (other than having on_finish broken tho)
08:40 sri ye, there are very little reasons
08:41 diegok ...and, do you have any ideo if release date for 2.0?
08:41 sri this year i think
08:42 diegok :)
08:42 sri ;p
08:42 diegok I hope so
08:49 regueifa joined #mojo
08:51 stephan48 this year? not 2012?
08:59 batman https://gist.github.com/1274910 # i'm trying out the ws echo example, but the "on_message" callback is called after "a" and "b" is sent over the wire, even though the server replies at once.
09:00 batman what am i doing wrong? i was hoping it would print "send_message(a)\necho: a\nsend_message(b)\necho b\n"
09:00 batman instead of "send_message(a)\nsend_message(b)\necho a\necho b\n"
09:02 smpb joined #mojo
09:12 Eugene joined #mojo
09:15 sri wow, breaking bad finale was great
09:16 sri marcus: you were right, it got better later on
09:17 sri the episode title "face off" is spot on :D
09:22 marcus \o/
09:39 batman hm... it works if i do Mojo::UserAgent->new(ioloop => Mojo::IOLoop->singleton); instead of just Mojo::UserAgent->new
09:41 sri batman: the whole api is non-blocking, don't use it like it was blocking
09:41 sri and there is no need to mess with the ioloop once it's running
09:46 sri in fact, unless you know exactly what you're doing it's a recipe for disaster
09:46 batman ok
10:04 jwang joined #mojo
10:05 Eugene joined #mojo
10:20 regueifa joined #mojo
10:47 spleenjack joined #mojo
10:53 crab i wish i had more direct control over the session cookie
11:02 batman joined #mojo
11:02 stephan48 hijack the users pc?
11:08 cervlean joined #mojo
11:10 cervlean is there a known issue with the performance of eval under mojolicious?
11:11 cervlean eval {}
11:14 cervlean e.g. 'eval { die "foo" } for 1 .. 10000;' runs in 0.018s on my laptop outside of mojolicious
11:15 cervlean but takes 1 1/2 minutes inside a mojolicious route
11:15 sri local $SIG{__DIE__};
11:15 purl it has been said that local $SIG{__DIE__}; is equiv to 'DEFAULT';
11:16 sri we wrap exceptions for pretty stack traces
11:17 cervlean ah ok, so i can just turn off locally ... thx
11:22 crab stephen: er, from my code
11:22 crab e.g. setting per-cookie expires and so on
11:45 marcus crab: You can set per session expires tho?
11:49 stephan48 crab: oh.... you ment it this way... ohm sry
11:54 sri switching from callbacks to events does cost rps according to my tests
11:54 sri at 1500 rps, the cost would be 5
11:55 sri does seem worth it :)
12:06 marcus yeah
12:08 stephan48 5rps?!
12:08 stephan48 no!
12:09 marcus 0.03%?
12:09 stephan48 and!
12:12 marcus stephan48: I can't tell if you're kidding
12:13 stephan48 just dont make the mistake and take me serious and you will be fine...
12:14 marcus stephan48: too many people are stupid about performance to make jokes about it :)
12:15 stephan48 i fucking dont care of the fucking app makes 200 or 205 rps....
12:17 marcus stephan48: Actually the difference would probably be a lot less at that scale
12:17 stephan48 yap
12:18 spleenjack joined #mojo
12:22 preflex_ joined #mojo
12:50 batman joined #mojo
12:54 tabbi joined #mojo
12:54 tabbi left #mojo
13:26 elb0w tempire: still using server?
13:38 regueifa joined #mojo
13:52 sri hmm
13:52 sri now that i'm finished it's more noticeable
13:52 sri at 1600 rps it can be between 30-50
13:52 elb0w sri what do you think the closest framework to mojo is for ruby? sinatra?
13:53 sri none
13:53 elb0w ya
13:53 elb0w r
13:53 elb0w er
13:53 elb0w oh yeah?
13:53 purl totally!
14:03 noganex joined #mojo
14:04 fmerges joined #mojo
14:09 sri not sure anymore if moving to full events is such a good idea
14:10 elb0w sri: there any licensing issues if I use mojo as a backend to a mobile app and get investors?
14:11 elb0w Like anything I need to be aware of?
14:11 regueifa joined #mojo
14:11 elb0w heh always do
14:11 elb0w er wrong window
14:16 sri artistic license is a very permissive license
14:17 sri you should read it
14:23 elb0w o ok no issues then
14:23 elb0w ty
14:26 amoore joined #mojo
14:29 ispy_ joined #mojo
14:32 koban left #mojo
14:48 metaperl joined #mojo
14:58 abra joined #mojo
14:59 sugar joined #mojo
15:17 regueifa joined #mojo
15:30 tholen joined #mojo
15:33 kaare joined #mojo
15:42 met joined #mojo
15:49 Foxcool joined #mojo
16:02 metaperl elb0w: sinatra and camping according to this thread - http://www.reddit.com/r/programming/comments/ejuqd​/mojolicious_web_framework_a_next_generation_web/
16:10 tempire elb0w: it has yet to be used.  it will, though, for the next episode, or possibly the next after that.
16:11 tempire sri: not a good idea?  feeling the heat from the dahl fallout?
16:11 sri tempire: ?
16:12 tempire regarding "not sure anymore if moving to full events is such a good idea"
16:12 sri nono, i've been testing a few changes in mojolicious where i'm replacing callbacks with events
16:12 tempire I like the ua events thing a lot better than $tx->on_request->($tx)
16:13 tempire what's the downside to moving to events?
16:13 sri i'm not sure because it costs a bit
16:13 tempire ah
16:13 sri i'm down to 20rps cost again… so it's not that bad
16:13 tempire but it's non-blocking so it's crazy fast!!!!
16:13 tempire I read it on the internet.
16:13 sri -.-
16:14 tempire well, mark me down for supporting the idea.
16:14 tempire but I'll love you regardless.
16:14 sri \o/
16:14 * tempire hugs sri unconditionally
16:15 perlrocks Twitter: "@miahfost Being a #mojolicious activist means I'm pretty updated on Web Sockets. Lectures work again now tho.." --marcusramberg http://twitter.com/marcusramb​erg/status/123431498387963904
16:18 perlrocks Twitter: "@marcusramberg <3 for mojolicious. I've mirrored them on stantheman.biz/ai" --MLACitation http://twitter.com/MLACitati​on/status/123432210857598977
16:26 crab marcus: how can i set per-session expires?
16:28 njlg joined #mojo
16:34 met left #mojo
16:40 sromanov joined #mojo
16:52 batman joined #mojo
16:56 GitHub121 joined #mojo
16:56 GitHub121 [mojo] kraih pushed 1 new commit to master: http://git.io/Si7pWg
16:56 GitHub121 [mojo/master] renamed Mojo::IOLoop::EventEmitter to Mojo::EventEmitter and improved many modules to use events instead of callbacks - Sebastian Riedel
16:56 GitHub121 left #mojo
16:57 sri diegok: please test :)
17:00 perlrocks Twitter: "In #mojolicious 2.0 we'll bring events to all layers, should be a lot of fun. :) http://t.co/ZdSbGyD4 #perl" --kraih http://twitter.com/kraih/status/123442811734466560
17:01 diegok sri: I'll test tonight. I'll see if my hack still works and I'll move to the new event api then :)
17:06 GitHub120 joined #mojo
17:06 GitHub120 [mojo] kraih pushed 1 new commit to master: http://git.io/yFcP-Q
17:06 GitHub120 [mojo/master] fixed typo - Sebastian Riedel
17:06 GitHub120 left #mojo
17:07 sri ideas for making eventemitter faster would be welcome btw
17:16 gbacon joined #mojo
17:22 amoore joined #mojo
17:28 metaperl joined #mojo
18:25 PerlNinja joined #mojo
18:37 kmx joined #mojo
18:46 metaperl|2 joined #mojo
19:00 ispy_ joined #mojo
19:15 GitHub32 joined #mojo
19:15 GitHub32 [mojo] kraih pushed 1 new commit to master: http://git.io/sH1_Qg
19:15 GitHub32 [mojo/master] better event emitter example - Sebastian Riedel
19:15 GitHub32 left #mojo
19:26 preflex_ joined #mojo
19:40 perlrocks Twitter: "@miahfost @kraih deserves the credit. I just help out when I can. #mojolicious" --marcusramberg http://twitter.com/marcusramb​erg/status/123482980458053632
19:42 MojoGuest664 joined #mojo
19:42 MojoGuest664 From: http://news.ycombinator.com/item?id=1277067 (17 hits)
20:13 ispy_ joined #mojo
20:26 sugar joined #mojo
20:28 grim_fandango joined #mojo
20:42 abra joined #mojo
20:43 PerlNinja hola mojoistas, what's the commonly accepted way to delete a cookie? Set it with an empty value?
20:50 MojoGuest387 joined #mojo
20:50 MojoGuest387 From: http://www.google.se/url?sa=t&amp;source=web&​amp;cd=4&amp;ved=0CDUQFjAD&amp;url=http%3A%2F​%2Fdev.xantus.org%2F&amp;rct=j&amp;q=html5%20​irc&amp;ei=O1qTTrKjIsqD4gSBu_lH&amp;usg=AFQjC​NGw6nZv0wO42uzUnHhWcD0vcKNULg&amp;cad=rja (1 hits)
20:51 perlrocks Twitter: "@rcarmo I know you do. You are in a bad place, I don't blame you. You might enjoy Mojolicious even more though, more your style I'd guess" --pedromelo http://twitter.com/pedromel​o/status/123500856502001664
20:57 ispy_ joined #mojo
21:14 tabbi joined #mojo
21:15 tabbi hi
21:15 tabbi how can i send a pdf file from a controller action?
21:15 tabbi i tried with: $self->res->headers->content​_type("application/x-pdf");
21:15 tabbi $self->res->body(scalar file($filename)->slurp);
21:15 tabbi $self->res->code(200) unless $self->res->code;
21:16 tabbi the i get an error in the logs:
21:16 tabbi Can't call method "app" without a package or object reference at /usr/local/share/perl/5.10.​1/Mojolicious/Controller.pm line 45
21:17 tabbi any ideas what´s wrong with the code?
21:21 PerlNinja no idea, looks like it should work...
21:25 regueifa joined #mojo
21:44 tabbi now i have changed it to use $self->render_static which works well
21:46 regueifa joined #mojo
21:48 tabbi left #mojo
22:03 tempire tabbi: you probably need to add a mime type
22:03 tempire and you can use Mojolicious::Static to serve an existing file
22:04 tempire actually, you don't need a mime type, I don't think. just the ::static
22:05 tempire https://gist.github.com/1273125, for those interested
22:05 tempire oh, he already found a way.  doh.
22:05 PerlNinja well the way he found is exactly what you just typed :)
22:06 PerlNinja tempire, any new mojocasts forthcoming?
22:06 tempire yes
22:07 PerlNinja \o/ tempire++
22:07 MojoGuest917 joined #mojo
22:07 MojoGuest917 From: http://news.ycombinator.com/item?id=1277067 (18 hits)
22:07 MojoGuest917 /part
22:08 MojoGuest917 /exit
22:08 MojoGuest917 left #mojo
22:08 PerlNinja silly question but who are those MojoGuest people?
22:08 MojoGuest483 joined #mojo
22:08 MojoGuest483 From: http://news.ycombinator.com/item?id=1277067 (19 hits)
22:13 PerlNinja nm :D nice, web based irc client... good stuff
22:35 metaperl joined #mojo
22:37 xaka joined #mojo
22:38 MojoGuest509 joined #mojo
22:39 xaka what would be the best common way to raise an exception when i'm trying to get req->json while request isn't json?
22:44 s0va sri: hello, i found another problem :)
22:45 s0va mojo + EV + Coro::Mysql
22:45 s0va the same sub blocks under mojolicious, but this is not the case under pure anyevent::httpd
22:45 s0va interested in code that triggers it?
23:00 s0va this one works as expected: http://pastebin.com/cTUzip5T
23:03 s0va this one http://pastebin.com/rAd3XDC0 blocks on long running queries (/fast doesn't return until /mysql/coro/sth completes)
23:23 PerlNinja joined #mojo
23:42 driller_work joined #mojo
23:42 driller_work hi all
23:44 driller_work is there a way to get around having a foreach initialize inside a template if I use a if else? if ( stash 'error ) { ...do something.. } else { foreach $something (@array ) { .. } }
23:46 driller_work but for whatever reason it is complaining about "Global symbol '...' requires explicit package name at template gallery.html.ep" and refers to my foreach which shouldn't have been called since there was a stash message 'error'
23:47 j3nnn1 joined #mojo
23:48 sugar my $something?
23:49 driller_work but do I intialize those in the template?
23:49 driller_work declare''
23:50 driller_work thing is, those variables have values... if I declare those inside the template they would be empty and when ran in the foreach loop it wouldnt do what I want, since the variables would be empty..
23:51 sugar hmm. you can init some vars in template
23:52 sugar good night, i need to sleep =)
23:52 driller_work but why does it even call the foreach loop :o

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