Camelia, the Perl 6 bug

IRC log for #mojo, 2010-08-27

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

All times shown according to UTC.

Time Nick Message
00:16 xantus_ guess I'll be driving my ass off this weekend
00:17 DaTa perl -Mojo -E 'oO("http://dl.dropbox.com/u/5558867/anon.json")->json' dont now if it runs forever, canceled it after 2 minutes :)
00:18 DaTa good n8 :)
00:19 sri DaTa: umm
00:19 sri MOJO_CLIENT_DEBUG=1 perl -Mojo -E 'oO("http://dl.dropbox.com/u/5558867/anon.json")->json'
00:19 sri that will show you the answer :)
00:20 xantus_ 1.8mb json file, lol
00:22 xantus_ it takes json_xs a bit to parse that
00:22 sri poor regex parser
00:22 xantus_ json_xs -t yaml <anon.json
00:23 xantus_ ~7s
00:24 xantus_ sri, did you add that JSON parser env var?
00:24 xantus_ so JSON::XS and friends can be forced
00:24 sri don't think so, marcus has been ranting that we have too many env vars :S
00:24 stephen left #mojo
00:25 xantus_ pssshaaa
00:25 DaTa xantus_: that's yaml generation, -t json-pretty is done in no time
00:25 stephen joined #mojo
00:26 und3f is now known as und3f[A]
00:26 * xantus_ nods
00:26 xantus_ easier to read sometimes
00:31 fod left #mojo
00:55 GitHub55 joined #mojo
00:55 GitHub55 mojo: master Sebastian Riedel * 93d0fca (19 files in 11 dirs): simplified transaction pausing by replacing it with an automatism - http://bit.ly/bb4bgo
00:55 GitHub55 left #mojo
00:57 sri daemon.t will return as hypnotoad.t :)
00:58 sri http://github.com/kraih/mojo/blob/m​aster/t/mojolicious/lite_app.t#L358 # async is now as easy as this
01:00 sri actually i can still make it easier :)
01:15 GitHub64 joined #mojo
01:15 GitHub64 mojo: master Sebastian Riedel * 0bf8825 (3 files in 2 dirs): added async finish test and fixed small bug - http://bit.ly/co1wWw
01:15 GitHub64 left #mojo
01:23 GitHub121 joined #mojo
01:23 GitHub121 mojo: master Sebastian Riedel * 43af16d (1 files in 1 dirs): log delayed responses - http://bit.ly/cyRldu
01:23 GitHub121 left #mojo
01:23 ltriant left #mojo
01:23 ltriant joined #mojo
01:24 ltriant left #mojo
01:28 ltriant joined #mojo
01:30 ltriant left #mojo
01:33 ltriant joined #mojo
01:34 ltriant left #mojo
01:38 ltriant joined #mojo
02:35 janus left #mojo
02:35 janus joined #mojo
02:45 [1]awnstudio joined #mojo
02:49 awnstudio left #mojo
02:49 [1]awnstudio is now known as awnstudio
02:54 [1]awnstudio joined #mojo
02:58 awnstudio left #mojo
02:58 [1]awnstudio is now known as awnstudio
03:00 yakudzo joined #mojo
03:02 GitHub69 joined #mojo
03:02 GitHub69 mojo: master Sebastian Riedel * 7fbeb72 (5 files in 5 dirs): improved long polling - http://bit.ly/bhUXX7
03:02 GitHub69 left #mojo
03:05 GitHub155 joined #mojo
03:05 GitHub155 mojo: master Sebastian Riedel * 4f3f947 (1 files in 1 dirs): cleanup - http://bit.ly/b43U11
03:05 GitHub155 left #mojo
03:16 GitHub183 joined #mojo
03:16 GitHub183 mojo: master Sebastian Riedel * 96fb762 (2 files in 1 dirs): cleanup - http://bit.ly/bRaghD
03:16 GitHub183 left #mojo
03:21 awnstudio left #mojo
03:33 GitHub147 joined #mojo
03:33 GitHub147 mojo: master Sebastian Riedel * dfdecc5 (2 files in 1 dirs): pod cleanup - http://bit.ly/bIXDeb
03:33 GitHub147 left #mojo
03:54 ltriant left #mojo
03:56 ltriant joined #mojo
04:04 tl joined #mojo
04:04 ash_ left #mojo
04:06 tholen42 left #mojo
04:08 GitHub125 joined #mojo
04:08 GitHub125 mojo: master Sebastian Riedel * fa3dbe8 (2 files in 2 dirs): cleanup - http://bit.ly/ajFMJB
04:08 GitHub125 left #mojo
04:09 janus someone can't sleep? :)
04:11 GitHub173 joined #mojo
04:11 GitHub173 mojo: master Sebastian Riedel * 08a5f8d (1 files in 1 dirs): pod cleanup - http://bit.ly/c8YZRH
04:11 GitHub173 left #mojo
04:11 sri :S
05:11 koban joined #mojo
05:12 koban left #mojo
05:12 koban joined #mojo
05:22 polvo how do i get current request method from a controller?
05:26 polvo $req->method
05:27 koban polvo: $self->req->... in your controller
05:28 polvo koban, already found out :)
05:28 koban ;)
05:33 omega there is no "formal" way in mojolicious to specify a model?
05:36 janus as formal as "use mymodel;"
05:52 MojoGuest743 joined #mojo
05:52 MojoGuest743 From: http://www.google.com.br/search?sourcei​d=chrome&amp;client=ubuntu&amp;channel=​cs&amp;ie=UTF-8&amp;q=websockets+demo (1 hits)
05:52 MojoGuest743 left #mojo
05:52 MojoGuest161 joined #mojo
05:52 MojoGuest161 From: http://dev.xantus.org/ (1 hits)
05:53 MojoGuest161 left #mojo
05:55 janus out of curiousity and because i measured yesterday: who's your perl/db-code quota? mine is currently 1:3,7 :)
05:56 janus s/who/how/
06:10 und3f[A] is now known as und3f
06:33 yko joined #mojo
06:44 xantus_ left #mojo
06:44 xantus joined #mojo
06:57 janus yikes, a semicolon at the end of a single sql statements out of thousands crashes DBI/DBD::Pg on one machine
06:58 und3f is now known as und3f[A]
06:59 janus one of these days...
07:01 janus and i'd really appreciate if DBI had a method to wrap these calls: $sth->bind_columns(\( @row{ @{$sth->{'NAME_lc'}} } ));
07:02 janus i mean sure, i can copy my subclasses, but isn't everyone doing it anyways?
07:03 janus typing it sucks, but it's performance beats everything else imho ;)
07:26 ltriant left #mojo
08:15 marcus omega: in startup, you can typically do stuff like $self->defaults( model => MyModel->new(..) );
08:16 marcus omega: and $self->stash->{model} will be available in every request.
08:38 jest joined #mojo
08:42 omega marcus: aha, ok
09:10 koban left #mojo
09:14 koban joined #mojo
09:44 arthas joined #mojo
09:47 Htbaa joined #mojo
10:31 MojoGuest196 joined #mojo
10:31 MojoGuest196 test
10:33 MojoGuest196 left #mojo
10:39 janus anything
10:46 arthas left #mojo
11:03 MojoGuest809 joined #mojo
11:03 yakudzo left #mojo
11:10 cristi8 joined #mojo
11:21 MojoGuest809 left #mojo
11:30 esskar left #mojo
11:39 yakudza joined #mojo
12:22 * sri yawns
12:23 sri please test the latest version on github
12:29 sri and forget all you learned about ->pause, it's gone
12:39 koban sri: no more test for daemon?
12:41 sri daemon is tested in every second test file
12:42 sri daemon.t will return as hypnotoad.t
12:42 sri every application test uses the real daemon and real client
12:42 koban ok
12:46 janus openbsd/kqueue still happy
12:46 sri :)
13:04 yko sri: in async client requests we shouldn't call 'pause', but hsould call 'resume' when callback finish, right?
13:21 sri yko: wrong
13:22 sri as long as you have not rendered anything yet the ->render call will take care of everything
13:22 sri let me show you an example
13:23 sri btw. $self->resume is gone too
13:23 sri http://github.com/kraih/mojo/blob/m​aster/t/mojolicious/lite_app.t#L365
13:23 sri here
13:23 sri thats really all
13:24 sri mojolicious will now notice that you have not rendered anything and switch to delayed response mode internally
13:25 sri $tx->resume has changed a bit too, it now simply triggers a write attempt and goes idle again once no more data can be written and waits for the next $tx->resume
13:26 sri $tx->resume now gets called by $self->rendered
13:26 sri (usually)
13:26 sri so all you really have to care about is rendering stuff or using the ->write* methods
13:26 yko hmm
13:26 sri they do ->rendered automatically
13:27 yko http://korshak.name/ra/oo.jpg
13:29 yko so, instead of resume, i need to call render(...) or render_* from callback?
13:29 sri or just ->rendered
13:29 sri you tell mojolicious when you are ready to write
13:29 sri instead of delaying it manually with pause
13:29 sri kinda inverted
13:29 yko hmm... looks logic for newbie, who doesnt know about pause/resume :)
13:30 sri thats the point :)
13:30 sri it also warns you with a debug message if you forget to render
13:30 sri ->debug('Delayed response.') or so
13:30 yko but if i don't make any async calls from action and don't render anything - will mojolicious do auto-render as it was before?
13:31 sri yes
13:31 sri no tests broken
13:31 yko great. thank you for answers
13:32 sri http://github.com/kraih/mojo​/blob/master/lib/Mojo.pm#L95
13:32 sri thats the minimalistic mojo example
13:32 sri you can see the resume call telling mojo that it can start writing now
13:32 yko oh... now it's absolutely clear... we still have ->resume if we really need it
13:33 yko i just thought about situations outside mojolicious, but with client
13:33 sri ye, but it works more simplistic
13:34 sri don't think we have tests for such a client case
13:35 yko :)
13:36 sri that would be kinda long pushing :)
13:37 sri if you come up with a use case and tests i make it work as always :)
13:38 yko i don't if something broken at the moment :)
13:38 yko but if i will have time - as usually... well, you know :)
13:39 sri well, what matters to me is if i break tests
13:41 sri maybe ->resume needs a new name
13:41 sri i just don't know what would be appropriate
13:42 sri ->resume is maybe a bit too generic, ->start_writing or so could be easier to understand
13:43 yko as far as i understand just now if in existing code that worked with pause/resume remove all 'pause' it should work as supposed
13:44 sri you also remove ->resume
13:44 sri there is no more $self->resume
13:44 sri ->resume is lower level only now
13:44 yko )
13:46 sri you really just need ...->client->async->... and it's async
13:46 sri the render call in the client callback will do the work
13:47 sri basically all Mojolicious::Controller methods will do the right thing for you if they generate a response
13:48 sri you can completely forget about pausing
13:52 jest left #mojo
14:10 ash_ joined #mojo
14:21 GitHub178 joined #mojo
14:21 GitHub178 mojo: master Sebastian Riedel * 957756a (1 files in 1 dirs): cleanup - http://bit.ly/9IMsmo
14:21 GitHub178 left #mojo
14:22 Htbaa left #mojo
14:23 vel joined #mojo
14:23 vel left #mojo
14:24 sri i suspect that could become a common mstake
14:25 sri if you don't render anything and auto rendering can't find anything you would get this message and a timeout
14:27 yko I don't think so much people will use async. Or i'm wrong?
14:27 sri i will use it a lot
14:27 yko :)
14:27 yko and vti, for sure
14:28 sri but even if they don't use async, if nothing can be rendered mojolicious will go into async mode
14:28 sri so we need a good debug message
14:29 sri $self->log->debug('Waiting for delayed rendering or you forgot to render.')
14:29 sri maybe?
14:31 yko This situation may occur if no corresponding static file and no corresponding action exists. or action exists, but after it's execution 'rendered' flag still not set. ye?
14:31 sri no
14:31 sri first two result in 404
14:31 sri the last one yes
14:32 sri only if an action gets execured but nothing rendered basically
14:32 sri *executed
14:34 yko so, in last situation client will have 5s to wait and gen... nothing :) maybe in last situation it's better render exception or at least 404?
14:34 yko *get
14:35 yko i mean, without timeout...
14:35 sri how?
14:36 sri we would need pause/resume back to make that work
14:36 yko hmm, i don't know, i didn't see the code yet :D
14:36 sri thats the whole point
14:36 yko hmm. you are right
14:36 yko now i bit better understand how it works
14:36 sri if your action runs fine but you don't render a response you were previously pretty much screwed anyway
14:37 sri 404 is wrong no matter what
14:37 yko aha.. hmm
14:37 yko but it would be really common mistake
14:37 sri possible
14:37 sri thats why i'm looking for a good message
14:37 yko well, i think wi will have feedback in a single week :(
14:37 yko :) i mean
14:38 sri $self->log->debug('No response rendered, waiting for delayed rendering.')
14:38 sri that should work i guess
14:39 sri points directly at the users mistake
14:39 yakudza left #mojo
14:40 yko maybe 'Time out. Did you forget to render at controller#action?'
14:40 sri logging happens before timeout
14:40 GitHub83 joined #mojo
14:40 GitHub83 mojo: master Sebastian Riedel * dc1abc6 (1 files in 1 dirs): cleanup - http://bit.ly/aXCUnc
14:40 GitHub83 left #mojo
14:41 sri the timeout happens inside the web server, we don't control it
14:41 yko oh, ye. btw is there any message when time out?
14:41 yko :'(
14:41 sri and i don't think we should
14:41 yko i had that trouble with slow backend, which required more than 15s to answer
14:41 sri Oo
14:42 sri well, we don't control the server
14:42 yko spent much time before i guess why sometimes i have empty result
14:42 sri i think i recently reduced the timeout from 15 to 5 seconds :o
14:42 yko i saw that :)
14:43 yko so there would be much more cases like my. 5s isn't too much, i think you need it to prevent client long wait if nothing rendered
14:44 yko but if i have slow *something* inside, i will have roaming bug when sometimes client get just empty response
14:44 yko and no any debug messages about that :)
14:44 sri correct configuration is your responsibility
14:44 sri timeouts happen
14:44 yko but default - your :p
14:45 sri not really
14:45 sri i make sure the msot common cases get the best performance
14:45 yko well, i know about this issue, i hope next time ill face this problem i will know what to do. but newbies.... :D
14:45 yko ok, ok, i don't insist
14:45 sri for example long polling will always need a custom server configuration
14:56 sri i think the message is better than the previous 404 out of nowhere
15:04 koban left #mojo
15:06 sri i go lower level with the message
15:06 GitHub159 joined #mojo
15:06 GitHub159 mojo: master Sebastian Riedel * af92a28 (2 files in 2 dirs): cleanup - http://bit.ly/cFkTiV
15:06 GitHub159 left #mojo
15:07 yko sri++
15:07 yko i like that
15:08 sri :)
15:15 und3f[A] is now known as und3f
15:30 nuclon joined #mojo
15:39 yko left #mojo
15:46 MojoGuest803 joined #mojo
15:46 MojoGuest803 left #mojo
16:00 perlrocks Twitter: "Very surprising how few #perl people actually know about modern web technologies, i might have to pick this up in my blog. #mojolicious" --kraih http://twitter.com/kraih/status/22277873079
16:09 MojoGuest967 joined #mojo
16:09 MojoGuest967 From: http://news.ycombinator.com/item?id=1277067 (39 hits)
16:09 MojoGuest967 left #mojo
16:35 ysyrota left #mojo
16:57 vti i like those "cleanups" :)
17:27 ash_ left #mojo
17:27 ash_ joined #mojo
17:33 fod joined #mojo
17:38 MojoGuest64 joined #mojo
17:38 MojoGuest64 From: http://www.google.nl/search?rlz=1C1___​__en___NL386&amp;aq=f&amp;sourceid=chr​ome&amp;ie=UTF-8&amp;q=websocket+demo (1 hits)
17:39 MojoGuest64 hello
17:39 xantus hi
17:39 MojoGuest64 /name woeiwoei
17:39 xantus its /nick
17:40 MojoGuest64 yeah I just remembered that :)
17:40 xantus sri: I like the new changes
17:40 MojoGuest64 is now known as woeiwoei
18:06 stephen left #mojo
18:06 stephen joined #mojo
18:07 Htbaa joined #mojo
18:38 skaurus joined #mojo
19:03 yko joined #mojo
19:18 perlrocks Twitter: "One word: #Mojolicious: @ItaliaTrent #Film" --danperezfilms http://twitter.com/danpere​zfilms/status/22291625278
19:26 sri \o/
19:27 * sri waves fist angrily at those bad film makers
19:33 xantus those fuckers
19:54 skaurus sri: how hypnotoad doing?
19:57 sri ALL GLORY TO THE HYPNOTOAD!
19:57 sri gonna test it on site with my customer first then release
19:57 sri but it will be faster than the prefork daemon
19:58 ash_ whats different about hypnotoad than prefork daemon?
19:58 sri dead simple hot deployment
19:59 sri as in upgrade your perl while the server keeps running
19:59 ash_ will it reload parts of the system if you make changes?
19:59 ash_ that might be nice
19:59 sri ?
19:59 skaurus sri: nice, glad to hear :)
20:00 sri we have --reload for development
20:00 ash_ but if it did that automattically...
20:00 sri hypnotoad hot deployment is the production quality version of it
20:00 sri not going to do it automatically
20:00 sri hypnotoad is multi process only
20:00 ash_ got ya
20:01 sri it will start a second manager with worker pool before bringing the old copy gracefully down
20:01 sri reusing file descriptors
20:02 sri for development the experience wouldn't be that great, since there is a delay
20:02 sri but the process is rather fool proof
20:02 woeiwoei left #mojo
20:02 sri it's more like catalyst restarting...which is meh
20:04 sri sure --reload can fail at times, but in 99% of all cases the user experience is great
20:04 sri i prefer that over being meh all the time
20:05 sri not sure yet how to handle websockets though, they kinda break the graceful shutdown process
20:06 sri maybe i'll set their timeout to 3 seconds or so
20:07 sri a streaming websocket is hard to shutdown gracefully, maybe impossible
20:08 sri maybe websockets should just be closed
20:08 ash_ i always thought it wouldn't be to hard to make a safe reboot system for something like this, it could check the filesystem and if there have been any changes, it relaunches itself, but it would need to maybe start it as a child first to make sure it starts correctly before doing a full switch to the new stuff
20:08 sri ash_: thats absolutely neccessary
20:08 sri ash_: also detecting file system changes is bad
20:09 sri in a production environment you want total control
20:09 ash_ not if you use a callback
20:09 sri in general it's wrong for production
20:09 ash_ OS X and linux both have ways of registering callbacks with the FS so there is no polling
20:09 sri it might detect changes before a new copy is entirely synced
20:09 ash_ the FS notifies your program when something its looking at changes, not the other way around
20:09 sri i'm talking production
20:09 ash_ you could turn it of in production
20:10 sri umm
20:10 sri if you are talking development we have all that
20:10 sri --reload just works
20:10 sri it detects all changes
20:10 sri without restart delay
20:12 sri hypnotoad is designed from the ground up for production environments, to the point where development with it won't be fun
20:12 ash_ got ya
20:14 sri production upgrade process is usually a ssh script, possibly using git to sync to the latest version followed by a USR1 signal for hot deployment
20:15 sri if the new version crashes the upgrade process is simply interrupted and the old one keeps going
20:16 sri i want to make that process as simple as possible, with production specific defaults
20:16 xantus sri: http://github.com/quartzjer/TeleHash
20:17 sri Oo
20:18 xantus a callback that is called when the server wants to shutdown
20:18 xantus could be used to graceful shutdown things like websockets
20:19 sri sure, but i'd like a sane default
20:19 xantus so would I
20:21 sri think i'll go with switching the timeout for all connections to 1 second or so
20:23 sri in the end this something you can only figure out in a real production setup over time
20:23 sri so i expect patches :)
20:27 xantus yea
20:27 xantus I'm off to st louis
20:27 xantus anyone in here near there?
20:27 sri have fun
20:28 xantus send me an email and I'll buy you a beer.  xantus at xant.us
20:28 sri don't let the hurricanes bite you
20:28 xantus hurricanes in middle america?
20:28 * sri only knows st. louis from the news when it gets hit by hurricanes
20:30 xantus bay st louis, mississippi
20:30 xantus only hurricane in st louis, mo is hurricane harbor
20:30 xantus the water park
20:30 xantus ;)
20:33 * xantus waves
20:33 xantus bbl
20:33 xantus left #mojo
21:30 xantus__ left #mojo
21:31 xantus joined #mojo
21:49 Htbaa left #mojo
21:57 und3f is now known as und3f[A]
22:22 nuclon left #mojo
22:28 MojoGuest793 joined #mojo
22:28 MojoGuest793 From: http://www.google.nl/search?sourceid=chr​ome&amp;ie=UTF-8&amp;q=html5+irc+client (1 hits)
22:28 MojoGuest793 left #mojo
22:34 MojoGuest306 joined #mojo
22:34 MojoGuest306 From: http://www.google.com/url?sa=t&amp;source=web&amp;​cd=2&amp;ved=0CBcQFjAB&amp;url=http%3A%2F%2Fdev.xa​ntus.org%2F&amp;rct=j&amp;q=extjs%20websocket&amp;​ei=Sz14TJ37OJSksQOy5eCtBQ&amp;usg=AFQjCNGw6nZv0wO4​2uzUnHhWcD0vcKNULg&amp;sig2=qTjDraQPcTV4RqQSevcuWw (1 hits)
22:36 MojoGuest306 left #mojo
22:53 yko left #mojo
23:12 su-bzero joined #mojo
23:17 su-bzero_ left #mojo

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