The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2015-12-13

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

All times shown according to UTC.

Time Nick Message
00:02 voldemortensen joined #mojo
00:03 voldemortensen2 joined #mojo
00:11 good_news_everyon joined #mojo
00:11 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/v0Z80
00:11 good_news_everyon mojo/master 62d0d71 Sebastian Riedel: stringify Mojo::Date objects consistently
00:11 good_news_everyon left #mojo
00:33 kafkaesque joined #mojo
00:55 berov sri: thanks!
01:01 asarch joined #mojo
01:07 sue joined #mojo
01:20 nnutter joined #mojo
01:45 voldemortensen joined #mojo
01:59 nnutter joined #mojo
02:28 nnutter joined #mojo
02:29 anon joined #mojo
03:33 noganex joined #mojo
03:43 cpan_mojo MojoX-Renderer-Handlebars-0.04 by RMZG https://metacpan.org/release/RMZG/MojoX-Renderer-Handlebars-0.04
04:00 Zoffix joined #mojo
05:30 Grinnz joined #mojo
05:38 nnutter joined #mojo
05:47 kaare joined #mojo
05:48 absolut_todd joined #mojo
06:41 nnutter joined #mojo
07:08 meshl joined #mojo
07:44 dod joined #mojo
07:59 Vandal joined #mojo
08:43 ladnaV joined #mojo
08:50 meshl joined #mojo
09:17 punter joined #mojo
09:33 dod joined #mojo
09:35 dod joined #mojo
09:45 henq joined #mojo
10:02 kafkaesque In my app I have a route and I am trying to grab json using my $json = $c->req->json; and I am hitting it like so curl -H "Content-Type: application/json" -d '{'foo':'bar'}' localhost:3000/test
10:02 kafkaesque but $json is undefined
10:03 punter kafkaesque: json has double quotes
10:03 kafkaesque I'm looking at this: https://github.com/kraih/mojo/wiki/Request-data
10:03 kafkaesque oh, well I'm an idiot
10:03 kafkaesque thanks
10:04 kafkaesque haha, thanks punter, that worked. You saved me a lot of time I imagine, since I'm obviously too stupid to have tried with doublequotes.
10:05 punter yw
10:44 SmokeMachine joined #mojo
10:47 bjakubski joined #mojo
10:47 Lucas1 joined #mojo
10:50 chansen joined #mojo
10:51 da5id joined #mojo
12:03 asarch joined #mojo
12:29 henq joined #mojo
12:33 trone joined #mojo
13:25 henq joined #mojo
13:29 aitap joined #mojo
13:30 absolut_todd joined #mojo
13:37 sue joined #mojo
14:26 henq joined #mojo
14:35 kafkaesque joined #mojo
14:46 chrisco1982 ya just remeber stack overflow is from not enough ram
14:47 chrisco1982 left #mojo
15:02 ghandi|work joined #mojo
15:02 ghandi|work Hi There! Is there an easy way to send a HTTP-Multipart-Response with Mojolicous?
15:24 kafkaesque joined #mojo
15:29 punter joined #mojo
15:36 jberger ghandi|work: http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Large-file-upload
15:40 ghandi|work jberger: Thanks, but this is for sending multipart data to the server. I'd like to generate a multipart response from server to client.
16:11 jberger ghandi|work: I'm not sure what that means?
16:12 jberger do you mean sending a file or streaming response?
16:18 jabberwok1 joined #mojo
16:18 PryMar56 joined #mojo
16:19 nnutter joined #mojo
16:41 henq joined #mojo
16:46 sh4 joined #mojo
16:56 noganex joined #mojo
17:01 berov joined #mojo
17:24 jontaylor joined #mojo
17:35 kafkaesque joined #mojo
17:50 sue joined #mojo
17:51 kafkaesque joined #mojo
17:53 sugar joined #mojo
17:58 trone joined #mojo
18:01 nnutter joined #mojo
18:07 sugar joined #mojo
18:11 sugar joined #mojo
18:16 sri jberger: found the with_protocols patch https://gist.github.com/anonymous/b81a3ac51448da08580e
18:27 jberger sri++
18:27 jberger though I think in the doc example I'd put v2 first
18:28 jberger since its most likely that you'd want to handshake on the highest supported protocol
18:31 sri question is how frozen Mojo::Transaction::WebSocket is
18:32 jberger I haven't gotten to it yet
18:32 jberger btw, the hash -> channel thing is making some progress (useragent side)
18:34 sri so, if the patch gets applied now, it wouldn't hurt your effort?
18:34 jberger nope
18:35 jberger and it'd help me at $work
18:36 jberger sri one thing though
18:36 jberger is that the correct transaction?
18:36 good_news_everyon joined #mojo
18:36 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/v0CDq
18:36 good_news_everyon mojo/master 1dfaf12 Sebastian Riedel: added support for negotiating WebSocket subprotocols
18:36 good_news_everyon left #mojo
18:37 jberger I put my header on the get request before the upgrade
18:37 jberger well, actually I can check it now
18:37 jberger :-P
18:38 sri yes, it is
18:38 sri extension and challenge negotiation is in that one too
18:40 jberger works beautifully \o/
18:40 jberger sri++
18:45 jberger so this refactor plan is nice because you can start by just blessing the hashref into the channel class and of course the tests still pass
18:45 jberger so you just start from there
18:46 nnutter joined #mojo
19:04 meshl joined #mojo
19:10 berov1 joined #mojo
19:12 jberger zomg zomg zomg
19:12 jberger new independence day movie!
19:12 sri Oo
19:13 jberger the preview was AMAZING
19:19 good_news_everyon joined #mojo
19:19 good_news_everyon [mojo] jberger created channel_jberger_2 (+5 new commits): http://git.io/v0Cbt
19:19 good_news_everyon mojo/channel_jberger_2 20a2777 Joel Berger: use a Channel class rather than bare hashref
19:19 good_news_everyon mojo/channel_jberger_2 20e86c1 Joel Berger: remove nb from _connect
19:19 good_news_everyon mojo/channel_jberger_2 f99123d Joel Berger: pass channel to _connect
19:19 good_news_everyon left #mojo
19:19 jberger sri: I think I need your help for the first time, I keep breaking keep alive with any change I make
19:20 jberger the last commit if I use the commented $self->_nb($c) keep alive breaks
19:20 jberger I don't understand how its any different
19:20 jnbek joined #mojo
19:26 sri hmm
19:29 sri in some tests $ua->ioloop is actually the singleton, i wonder if that causes problems
19:30 sri i don't see anything obvious though
19:30 jberger might be
19:31 sri if everything uses your new logic it should be fine, since all just share the nb queue, but if you're converting one by one, it might cause problems
19:31 nnutter joined #mojo
19:32 jberger what do you mean by everything?
19:32 jberger this is the last use of $c->{nb}
19:32 sri hmm, then it shouldn't be a problem
19:37 jberger well, maybe there's other stuff going on
19:37 jberger I'll keep on it
19:37 jberger I need to keep getting rid of _loop
19:42 jberger sri: why do you remove the connection from both loops? https://github.com/kraih/mojo/blob/master/lib/Mojo/UserAgent.pm#L298
19:42 jberger wouldn't it only be in one?
19:49 jberger I guess the issue is that you wouldn't know which one
19:53 nnutter joined #mojo
19:54 sri jberger: not sure actually :o
19:58 sri hmm, one test fails if that just uses $c->{nb}
19:58 jberger ?
19:59 jberger oh nm
20:00 jberger anyway, I think the problem is that there probably are times when the useragent is used non-blocking but NOT with the singleton
20:00 sri that does not sound right
20:02 kafkaesque joined #mojo
20:03 * sri looks into it
20:03 jberger with more diagnostics, you are probably right
20:03 sri removing it from both loops seems sketchy
20:04 jberger its failing when $c->{nb} is false but $self->_nb($c) is true
20:07 sri ah, i'm getting closer
20:07 sri _remove gets called from _enqueue, where connections might not have a $c->{connections} structure
20:08 sri this is for cleaning up keep-alive connections
20:11 kafkaesque joined #mojo
20:11 sri it's actually not as sketchy as it seems
20:12 sri just a defensive "remove all traces of this connection, we really want to get rid of it"
20:12 jberger yeah, I thought so
20:12 jberger "I guess the issue is that you wouldn't know which one"
20:18 jberger _remove calls _enqueue and _enqueue calls _remove
20:18 jberger is that ever going to cause a problem?
20:18 sri no
20:19 sri _enqueue only called _remove for connections without a $c->{connections} entry
20:19 sri so it can never hit _enqueue again
20:20 jberger that's not how I read it
20:21 jberger _enqueue is calling remove when there are more than max_connections
20:21 sri connections in the queue can't have a $c->{connections} entry
20:22 sri it gets deleted before an id gets put into the queue
20:22 jberger oh
20:22 jberger ok
20:22 sri hmm, thinking about it, that might be problematinc actually
20:25 sri i would clean that up if the user agent wasn't frozen :S
20:26 jberger you could clean it up on my branch
20:26 jberger I need to take a break for lunch anyway
20:26 sri i'm not familiar enough with that to do it
20:27 jberger ok
20:27 sri i have a patch for master
20:27 jberger paste?
20:28 sri https://gist.github.com/anonymous/cd6dbf0984969cda9559
20:29 bwf joined #mojo
20:29 sri that keeps the $self->{connections} structure around until it is not needed anymore
20:30 sri actually there's more that can be cleaned up
20:31 anon3252523 joined #mojo
20:32 jberger I think I'd rather have cleanups in, even if they break my current branch
20:32 jberger it will make things easier in the long run
20:32 jberger (as long as you are sure they won't be rolled back out)
20:33 kafkaesque if I put a sleep in my controller, will that impact all requests to that controller? I.e., does it block other requests, or just the one?
20:34 sri well, ok then
20:34 kafkaesque I am comparing a timestamp, and if the timestamp is less than 15 seconds ago, it sleeps for the difference (15 - timestamp = 10 seconds say).
20:34 good_news_everyon joined #mojo
20:34 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/v0Wqg
20:34 good_news_everyon mojo/master a78cb99 Sebastian Riedel: the connection is stateful
20:34 good_news_everyon left #mojo
20:35 sri that makes $self->{connections} persistent for the lifetime of a connection
20:35 kafkaesque Hey sri, I looked but didn't find it. Do you have a page showing where Mojolicious is used in big projects?
20:35 kafkaesque I'd be interested to see who is using Mojolicious.
20:36 kafkaesque Ah, timers! Haha, I swear this has everything.
20:40 kafkaesque sri, I know you get a lot of crap and not enough appreciation for what you're doing.
20:41 kafkaesque I just wanted to say I really appreciate all the stuff you're working on. I basically live in the environment you've created anymore (Mojolicious, Mojo::Pg, Minion).
20:41 kafkaesque Thanks for making such awesome stuff (and everyone here who has helped as well).
20:49 good_news_everyon joined #mojo
20:49 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/v0W3E
20:49 good_news_everyon mojo/master 745b91e Sebastian Riedel: make connection reuse and removal more clear
20:49 good_news_everyon left #mojo
20:49 sri jberger: that's more code, but i think much easier to work with
20:49 sri kafkaesque: glad you like it
20:51 henq joined #mojo
20:53 kafkaesque sri, like is a huge understatement, but yeah definitely.
20:56 henq joined #mojo
21:08 sri ah, CONNECT handling can be cleaned up too
21:16 henq joined #mojo
21:17 good_news_everyon joined #mojo
21:17 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/v0WcY
21:17 good_news_everyon mojo/master d317d1b Sebastian Riedel: handle CONNECT requests more gracefully
21:17 good_news_everyon left #mojo
21:21 henq joined #mojo
21:21 good_news_everyon joined #mojo
21:21 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/v0WCJ
21:21 good_news_everyon mojo/master 6b05ad5 Sebastian Riedel: no need to deal with the event loop directly
21:21 good_news_everyon left #mojo
21:22 sri jberger: that might be it
21:36 henq joined #mojo
21:58 henq joined #mojo
22:18 cbd_ joined #mojo
22:26 henq joined #mojo
22:34 henq joined #mojo
22:42 henq joined #mojo
22:49 henq joined #mojo
22:52 good_news_everyon joined #mojo
22:52 good_news_everyon [mojo] jberger created channel_jberger_3 (+1 new commit): http://git.io/v0WaF
22:52 good_news_everyon mojo/channel_jberger_3 01bd2b8 Joel Berger: use a Channel class rather than bare hashref
22:52 good_news_everyon left #mojo
22:56 sri oh, btw.
22:56 sri jberger: i've stumbled over an argument against the name Channel
22:57 sri channels are the most common name for connections multiplexed over a websocket
22:59 sri i guess this is why we'll never get http/2 without tls http://curl.haxx.se/mail/lib-2015-12/0053.html
23:00 sri jberger: that branch looks like a reasonable start
23:00 jberger thanks, I'm working on getting it back to where _2 was
23:01 jberger and I'm open to other names
23:01 sri yea, just bringing it up so we can think about new names, it's easy to change later on
23:15 jberger could it simply be Connection?
23:16 jberger hmmm, I guess that doesn't map onto http/2
23:16 asarch joined #mojo
23:17 good_news_everyon joined #mojo
23:17 good_news_everyon [mojo] jberger pushed 1 new commit to channel_jberger_3: http://git.io/v0Wot
23:17 good_news_everyon mojo/channel_jberger_3 8af2f90 Joel Berger: further reduce use of private data
23:17 good_news_everyon left #mojo
23:17 jberger anyway, I'll try to call them concistently $c for now
23:19 sri already looking cleaner
23:22 jberger there's still too much private data access
23:22 jberger and I'm not sure what to do about the cases where $ua->ioloop == Mojo::IOLoop->singleton
23:23 jberger I'm assuming that's still a problem for my $self->_nb($c) trick
23:23 sri not sure those would actually cause problems
23:23 jberger well I was just about to try it
23:24 cpan_mojo Mercury-0.007 by PREACTION https://metacpan.org/release/PREACTION/Mercury-0.007
23:26 cpan_mojo Statocles-0.061 by PREACTION https://metacpan.org/release/PREACTION/Statocles-0.061
23:30 jberger sri: perhaps a queue per ioloop?
23:33 sri sure
23:42 meshl joined #mojo
23:51 jberger you said that in the refactored version the queued connections stay in {connections} right?
23:52 jberger sri: ^^
23:52 sri yea
23:52 jberger ok, I'll want you to ok the following commit then
23:53 sri ohoh
23:53 sri what crazy shenenigans did you think of this time? :)
23:53 good_news_everyon joined #mojo
23:53 good_news_everyon [mojo] jberger pushed 1 new commit to channel_jberger_3: http://git.io/v0WPH
23:53 good_news_everyon mojo/channel_jberger_3 f6dc532 Joel Berger: queue connections based on ioloop
23:53 good_news_everyon left #mojo
23:53 jberger specifically this: https://github.com/kraih/mojo/commit/f6dc532615783010704fe0a50fd45890bcb62572#diff-955b07afef3c0b8632a50118b370262cR81
23:54 jberger it passes tests, but I don't know how to prove that it isn't leaving connections open
23:54 sri oh, well spotted
23:54 jberger wtf? its even misspelled
23:54 jberger argh
23:55 sri lol
23:55 jberger that's unnerving
23:55 jberger I fixed the typo and the tests ... still all pass
23:56 cbd_ How could one use the session method on the controller to manage session?
23:56 cbd_ s/could/would/
23:56 good_news_everyon joined #mojo
23:56 good_news_everyon [mojo] jberger pushed 1 new commit to channel_jberger_3: http://git.io/v0WX3
23:56 good_news_everyon mojo/channel_jberger_3 9d3a4ca Joel Berger: fix typo
23:56 good_news_everyon left #mojo
23:58 sri that's actually dead code in master
23:58 jberger ?
23:59 jberger can you highlight lines I can remove?
23:59 sri https://github.com/kraih/mojo/blob/master/lib/Mojo/UserAgent.pm#L78-L82
23:59 jberger oh that makes things easy then

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