Camelia, the Perl 6 bug

IRC log for #mojo, 2012-12-06

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

All times shown according to UTC.

Time Nick Message
00:00 sri after_dispatch is a general hook that runs when mojolicious is done, and there are many low level events you can hook into
00:01 sri you could get an event emitted whenever a new chunk of data has been written to the socket
00:03 sri what i want to solve is the problem of responses having too many forms, with a much more precise hook that only fires when the response can be modified safely
00:04 sri but i suppose that one recipe should stay... since it covers a few important low level aspects very advanced users should know about
00:04 sri after all, someone might want to build a post-processing plugin for multipart responses
00:06 sri this would be a lot easier if we just used chunked transfer encoding for everything and only supported streams :)
00:07 jnbek joined #mojo
00:11 freman I have to figure out how to make the websock client reconnect (and keep retrying) when the backend goes away
00:14 freman 6
00:14 freman oops, xchat is not my browser window
00:14 freman (honestly, you'd hate me if you saw how I've perverted mojo :)
00:15 freman is mojo::ioloop->recurring capable of accepting fractions of seconds?
00:17 freman yes, yes it is
00:18 good_news_everyone joined #mojo
00:18 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Z9lF-w
00:18 good_news_everyone mojo/master 875e65c Sebastian Riedel: better recurring example
00:18 good_news_everyone left #mojo
00:18 freman from the looks of it, 0 is valid too - just not generally sane :D
00:19 sri documented special case
00:20 sri oh, we have exactly 9700 tests now :)
00:21 zivester joined #mojo
00:21 freman mojo is awsome tho, it stands up well to my abuse, from forcing attributes upon it, to auto detection of routes, even to creating "event" routes for websocket communications
00:21 sri \o/
00:22 freman see if I can find an example... without feeling too embarrassed :)
00:27 freman http://pastebin.com/QGSAeVC2 - development module, only loaded and used against our test cases
00:29 freman the app communicates mostly in json so we render_ok and render_error, both of which know when a websock response is expected or a get/post response...
00:41 egopro joined #mojo
01:05 egopro joined #mojo
01:07 freman if a client websocket is disconnected (server went away, for eg) $tx->is_finished would return true?
01:07 freman or do I need to be checking on $tx->connection?
01:08 hlin joined #mojo
01:09 hlin_laptop joined #mojo
01:14 Mike-PerlRecruiter_ joined #mojo
01:25 freman I need a trace loglevel :(
01:29 freman app->ua->websocket($host . '/backend' => sub {warn "I get called"}) - I get called... even when the host is down and the socket doesn't get connected... how can I tell if it's connected (is_finished is false)
01:33 freman hmmm ok, check $tx->error
01:39 freman persistent websock - http://pastebin.com/vmq39B3Y - works, but is that how you'd do it?
01:39 freman oh, needs a return
01:40 freman http://pastebin.com/T4DLth21
01:51 CountryGeek The $69 one is pretty badass
01:51 CountryGeek Sorry
02:00 d4rkie joined #mojo
02:00 d4rkie joined #mojo
02:02 asarch joined #mojo
02:18 xaka joined #mojo
02:50 _xaka_ joined #mojo
03:08 egopro joined #mojo
03:50 egopro joined #mojo
03:59 noganex_ joined #mojo
04:03 egopro joined #mojo
05:03 Foxcool joined #mojo
05:24 Molaf joined #mojo
05:47 freman $tx->res->content->asset->move_to('mojo.tar.gz'); - how do I find out if it's a file asset before I move it?
05:47 freman (ie: I might not be expecting a file in the case of a common request library that does a whole bunch of other common things)
05:52 _xaka_ freman: http://mojolicio.us/perldoc/Mojo/Asset#is_file
05:52 freman thanks
05:52 freman I was just about to implement content type checks, probably should anyway :D
06:46 freman lol that broke tests - funnily enough I wrote the test library to present content type if given it but no-where in any of the tests did I present the content type :D
07:00 dpetrov_ joined #mojo
07:15 b2b joined #mojo
07:34 dabudabu joined #mojo
08:03 Vandal joined #mojo
08:12 arthas joined #mojo
08:16 xaka joined #mojo
08:18 batman joined #mojo
08:19 yakudza joined #mojo
08:22 suy joined #mojo
08:24 dod joined #mojo
08:26 judofyr joined #mojo
08:43 yakudza Hello. I want to route any url over https proto route to one action. How can I do this ?
08:47 dod joined #mojo
08:48 Averna joined #mojo
08:52 judofyr yakudza: bridge?
09:06 Vandal joined #mojo
09:07 vishwanathms joined #mojo
09:07 vishwanathms_ joined #mojo
09:11 yakudza judofyr, and in the bridge how can I point to controller that I need ? Or how can I render response in the bridge ?
09:13 judofyr yakudza: my $https = $r->bridge('/')->to(cb => sub { my $self = shift; $self->req->url->scheme eq 'https' })->detour(action => "foo")
09:14 yakudza wow thanks
09:14 yakudza so it is detour
09:14 judofyr yakudza: yeah, I realized it right now :)
09:14 judofyr yakudza: bridge for HTTPS + detour
09:14 judofyr detour allows partial matching
09:15 judofyr although I guess you could just do: ->any('/*path') too
09:16 marcus GOOD MORNING FELLOW HOOMANS
09:20 basic6 joined #mojo
09:50 alexeiras joined #mojo
10:04 bjoernfan Anybody using git-svn? (if it's okay with some off-topic)
10:05 bjoernfan Can't get it to dcommit to anything other than trunk.
10:05 judofyr bjoernfan: nope. tried #git ?
10:05 judofyr err, on Freenode
10:05 bjoernfan No, I'll check it out, thanks.
10:14 fhelmber_ joined #mojo
10:15 lukep joined #mojo
10:24 arthas joined #mojo
10:36 mattastrophe joined #mojo
10:39 cosmincx joined #mojo
10:44 lukep joined #mojo
10:51 spleenjack joined #mojo
10:58 nic Anyone written custom 'generate' templates?  (Don't have questions, just curious)
10:59 nic I'm just realising how useful it could be (in meetings) to be able to generate the starting files from within mojo itself
11:01 judofyr starting files?
11:01 nic Just like "mojo generate app" but with custom templates
11:02 nic "So you really need a web app for cataloguing flanges you say...  [mojo generate myapp flangicious]... something like this?"
11:22 sri o/
11:23 Averna joined #mojo
11:49 nic :)
11:52 ver joined #mojo
11:59 good_news_everyone joined #mojo
11:59 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/e-xHbg
11:59 good_news_everyone mojo/master bbb5fab Sebastian Riedel: updated example for IO::Socket::SSL 1.81
11:59 good_news_everyone left #mojo
12:36 sjn joined #mojo
12:49 mire_ joined #mojo
12:59 ladnaV joined #mojo
13:05 rem_lex joined #mojo
13:08 DaniBunny joined #mojo
13:10 DaniBunny joined #mojo
13:14 Mike-PerlRecruiter_ joined #mojo
14:10 dpetrov_ joined #mojo
14:11 sinkovsky joined #mojo
14:14 spleenjack joined #mojo
14:18 d4rkie joined #mojo
14:41 spleenjack1 joined #mojo
14:42 Adura joined #mojo
14:47 mire_ joined #mojo
14:56 bluescreen joined #mojo
15:00 SmokeMachine joined #mojo
15:15 Britzel joined #mojo
15:17 spleenjack joined #mojo
15:29 knshaum joined #mojo
15:42 kwa joined #mojo
16:16 ObseLeTe joined #mojo
16:16 bc547_ joined #mojo
16:35 tempire nic: it's dead simple
16:42 sri hmmm
16:42 xaka joined #mojo
16:42 * sri wonders if we should try gzip compressing session cookies :)
16:44 tempire would there be a benefit for small sessions?
16:44 * sri tests
16:46 judofyr sri: I think you only would find gains when it's bigger than maybe ~40 bytes
16:47 judofyr sri: wouldn't you have to base-encode it anyway?
16:47 judofyr nvm
16:52 tempire new file feature on github.  The site is now effectively a code editor.
16:53 sri first results don't look good
16:55 tempire Seems like that would be the case, especially given that large sessions are not encouraged.
16:56 sri break even point seems to be above 100 bytes, of course it depends on how compressible the data is
16:57 sri (unscientific observations while dumping the sessions in our unit tests)
16:58 Mike-PerlRecruiter_ joined #mojo
16:59 sri btw. i'm still looking for a method name to combine all the multipart/dynamic/file/range checks in this example http://mojolicio.us/perldoc/Mojolicious/​Guides/Rendering#Postprocessing_content
17:00 sri or some other way to make it easier
17:00 CountryGeek joined #mojo
17:01 tempire hmm
17:01 CountryGeek left #mojo
17:02 tempire is that what you where thinking about naming is_elastic?
17:02 sri yea
17:02 sri doesn't have to be an is_* method, could be a new hook too
17:03 sri like after_content, which gets emitted whenever ->render() assigns a new body value (so excluding partials)
17:05 bluescreen joined #mojo
17:06 sri but maybe i'm overthinking it, and post-processing shouldn't be simple :)
17:08 alnewkirk joined #mojo
17:08 tempire_ joined #mojo
17:10 alnewkirk joined #mojo
17:10 Kovensky joined #mojo
17:11 hide joined #mojo
17:16 duncanthrax joined #mojo
17:23 dod joined #mojo
18:11 mire_ joined #mojo
18:18 dod left #mojo
18:20 vel joined #mojo
18:20 dod joined #mojo
18:55 inokenty joined #mojo
19:05 good_news_everyone joined #mojo
19:05 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/hT8NHA
19:05 good_news_everyone mojo/master 8046ba6 Sebastian Riedel: fixed small paragraph bug in Mojo::DOM::HTML
19:05 good_news_everyone left #mojo
19:08 * sri accidentally the "or" from the html5 spec xD
19:11 yakudza joined #mojo
19:26 SmokeMac_ joined #mojo
19:28 lukep joined #mojo
19:30 freman joined #mojo
19:32 freman joined #mojo
19:54 b2b joined #mojo
20:05 vel joined #mojo
20:07 xaka joined #mojo
21:14 niczero joined #mojo
21:16 * niczero <3 https://metacpan.org/source/SRI/Mojolicious-​3.64/lib/Mojolicious/Command/generate/app.pm
21:40 sinkovsky joined #mojo
21:57 CountryGeek_away joined #mojo
21:57 b2b joined #mojo
22:08 CountryGeek_away joined #mojo
22:43 batman joined #mojo
22:53 mire_ joined #mojo
23:12 SmokeMachine joined #mojo
23:17 jzawodn joined #mojo

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