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

IRC log for #mojo, 2016-01-09

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

All times shown according to UTC.

Time Nick Message
00:18 bpmedley joined #mojo
00:28 jberger sri: I think realistically I'm not going to get a lot of time to refactor tonight, but have a look because: I propose a virtual hack-a-thon tomorrow
00:29 jberger I have the whole day
00:29 * jberger checks the calendar
00:29 sri sounds good
00:29 jberger actually, I have the whole weekend!
00:29 jberger \o/
00:29 sri batman, marcus, tempire, crab: virtual hackathon tomorrow!
00:29 * jberger goes to run errands, will check back in later
00:30 * sri is not actually hacking on the refactoring, just thinking about the api design
00:31 sri think there were like 3 open questions about the daemon
00:32 sri oh no, there was just one quirk
00:32 sri hehe, $c->{tx} and $c->{ws} existing at the same time ;p
00:36 sri hmm, a challenge
00:36 sri can we find a way to get rid of $c->{ws} in Mojo::Server::Daemon
00:36 sri as in make it reside somewhere else
00:37 sri it only exists for a very very short time
00:48 punter joined #mojo
00:55 zivester joined #mojo
01:04 sugar__ joined #mojo
01:16 tempire WOO
01:36 sri hmm, the upgrade event in Mojo::Transaction::HTTP is not even tested :o
01:36 sri i'm allowed to make changes! \o/
01:37 sri this is neat, i might be able to clean up the upgrade process after all
02:00 jontaylor joined #mojo
02:07 sri yea, works well :)
02:07 sri i'm also adding Mojo::Transaction::HTTP::next
02:08 sri for the followup Mojo::Transaction::WebSocket
02:08 sri we already have a ->previous attribute for redirects and stuff
02:17 good_news_everyon joined #mojo
02:17 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vuHK8
02:17 good_news_everyon mojo/master 219f612 Sebastian Riedel: the upgrade event in Mojo::Transaction::HTTP does not actually serve a purpose
02:17 good_news_everyon left #mojo
02:17 sri there is just no way anyone would be using that ;p
02:18 sri ->next is not the most elegant solution, but it's consistent and simple
02:21 good_news_everyon joined #mojo
02:21 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vuHK7
02:21 good_news_everyon mojo/master c319e7d Sebastian Riedel: no need to assign the transaction twice
02:21 good_news_everyon left #mojo
02:59 good_news_everyon joined #mojo
02:59 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vuH1V
02:59 good_news_everyon mojo/master ca8316a Sebastian Riedel: finish transactions a little more consistently
02:59 good_news_everyon left #mojo
03:01 noganex joined #mojo
04:00 noganex_ joined #mojo
04:04 jontaylor joined #mojo
04:26 vicash joined #mojo
04:28 vicash hello. while trying to debug some mojo code I tried to reproduce my unit test problem with the example given in Mojolicious::Guides::Growing. If you search for the string "Simplified tests" in that document, you will see the text_like() call being made. that fails for me. I get a 302 redirect to the "protected" route but I do not see the "Welcome string" in the unit test when I run the script with a "get" commandline option.
04:29 vicash However, the example works just fine in a browser. But the unit test provided in "Simplified tests" fails for me at the point where it is trying to match the text using text_like()
04:30 c--_ joined #mojo
04:51 vicash ah. i figured out my issue. it was with the way text_like() is being invoked as it isn't finding text unless the nested HTML tag is mentioned which is odd.
04:57 mattp joined #mojo
04:59 bpmedley joined #mojo
05:21 good_news_everyon joined #mojo
05:21 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vuHjh
05:21 good_news_everyon mojo/master cb3dbdd Sebastian Riedel: fix attribute order
05:21 good_news_everyon left #mojo
05:27 sri oh wow, gandi.net is really awesome
05:27 sri such a rare thing for a registrar
05:27 lb_ joined #mojo
05:27 orev1 joined #mojo
05:27 Gedge_ joined #mojo
05:28 sri apparently any gandi user can renew the domains of other gandi users
05:28 harleypig_ joined #mojo
05:28 diego_k joined #mojo
05:29 allison_ joined #mojo
05:29 graf joined #mojo
05:30 KindOne_ joined #mojo
05:30 dabudabu_ joined #mojo
05:30 crab_ joined #mojo
05:30 mrErikss1n joined #mojo
05:30 stryx`_ joined #mojo
05:31 jegade_ joined #mojo
05:31 Zx3_ joined #mojo
05:31 pink_mis1 joined #mojo
05:31 tinita joined #mojo
05:31 cfedde joined #mojo
05:31 tianon joined #mojo
05:32 al joined #mojo
05:32 zivester joined #mojo
05:32 * sri just stumbled over the x.org drama, where nobody has the account password and they might be losing that iconic domain
05:32 bayashi joined #mojo
05:32 talexb__ joined #mojo
05:32 skaji joined #mojo
05:32 ssm joined #mojo
05:32 Phil21 joined #mojo
05:32 dustinm joined #mojo
05:32 oalders joined #mojo
05:32 cosimo joined #mojo
05:33 preaction joined #mojo
05:33 Grinnz_ joined #mojo
05:33 robinsmidsrod joined #mojo
05:34 charsbar joined #mojo
05:34 mtths joined #mojo
05:34 salva joined #mojo
05:34 Bender joined #mojo
05:36 nicomen joined #mojo
05:36 bd joined #mojo
05:37 Jonis joined #mojo
05:37 mspo joined #mojo
05:37 HtbaaPi joined #mojo
05:38 coolo joined #mojo
05:43 batman joined #mojo
05:48 zivester_ joined #mojo
06:01 jontaylor joined #mojo
06:10 bpmedley joined #mojo
06:14 marcus joined #mojo
08:01 kaare joined #mojo
08:01 jontaylor joined #mojo
08:23 Vandal joined #mojo
08:47 melo joined #mojo
08:49 ashimema joined #mojo
09:21 kes joined #mojo
09:23 melo joined #mojo
09:32 jontaylor joined #mojo
09:43 sue joined #mojo
09:45 melo joined #mojo
09:56 Adura joined #mojo
10:03 batman sri: this is really a minor, but could $MTIME be $^T instead? https://github.com/kraih/mojo/blob/master/lib/Mojo/Asset/Memory.pm#L8
10:35 sugar__ joined #mojo
11:01 dod joined #mojo
11:07 dod joined #mojo
11:09 trone joined #mojo
11:10 jontaylor joined #mojo
12:05 odc joined #mojo
12:29 jontaylor joined #mojo
12:49 asarch joined #mojo
13:18 Matachin1 joined #mojo
14:09 punter joined #mojo
14:20 sri batman: i don't remember, does $^T change after a fork?
14:28 sri batman: looks like it should be fine
14:29 * sri is up for hackathoning
14:29 sri looking at the worldclock, most of the team should be awake now :)
14:33 good_news_everyon joined #mojo
14:33 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vu5vf
14:33 good_news_everyon mojo/master ee0f220 Sebastian Riedel: improve mtime attribute in Mojo::Asset::Memory to default to the value of $^T
14:33 good_news_everyon left #mojo
14:38 sue joined #mojo
14:48 * jberger yawns
14:48 jberger sri: glad you're excited
14:48 jberger I need a bite of breakfast and then I'll be ready
14:55 sri food sounds good
15:04 punter joined #mojo
15:06 * sri made some changes yesterday to prepare for the refactoring https://github.com/kraih/mojo/compare/3916e24a9b489566e189b486c60b69f56b564f2d...cb3dbdd4390085262bd1dedd760b5509ab506af0
15:19 vicash hello. is there a recommended way for using multiple controllers ? is that even a best practice ? let's say i have a Login controller and then I have some user-specific functionality that is available only for some users. Can I break that out into a separate Controller  class ? If so, how do I redirect to that controller from another controller.
15:19 bpmedley vicash : Yes, it's a good way to design you full app, imo.
15:20 bpmedley Do you need an example?
15:20 vicash yes bpmedley, an example will be helpful. thanks
15:21 batman sri: cool :) ($^T)
15:23 * batman got dinner in 40 min
15:27 bpmedley vicash : https://bitbucket.org/snippets/bpmedley/K8p6K <-- How is this?
15:28 jberger this is the interesting part of vicash's question " If so, how do I redirect to that controller from another controller." and it needs further clarification before it can be answered
15:29 jberger do you mean HTTP redirect, if so that's just redirect_to with the appropriate route name etc
15:30 jberger if you mean reuse code between classes then you either want to look at (a) sharing code via a base class, (b) helpers or (c) a model class that the controllers can use
15:34 vicash jberger: for now I mean HTTP redirect and I am guessing the format for the route name is $controller#$route_name from within a different controller
15:34 zivester joined #mojo
15:34 bpmedley vicash : Did my example make sense?
15:35 jberger vicash: no the route name is either determined by naming it explicitly or by taking the path and stripping non-word characters
15:36 jberger for anything but demos I'd recommend naming explicitly
15:36 vicash bpmedley: yes reading it right now. what is the difference between doing a call that goes 'redirect_to("dashboard")' vs 'redirect_to("/dashboard")' ?
15:36 jberger vicash: good question
15:36 jberger without the leading slash you're redirecting by name, since that is the generated name for the dashboard route (stripping out the /)
15:37 jberger referencing routes by name is really nice once you get started
15:38 good_news_everyon joined #mojo
15:38 good_news_everyon [mojo] jberger force-pushed channel_jberger_4 from a1cc9fc to 04f4a60: http://git.io/vEkxa
15:38 good_news_everyon mojo/channel_jberger_4 76c5ea0 Joel Berger: port to Channel object for UserAgent...
15:38 good_news_everyon mojo/channel_jberger_4 62ad0a0 Joel Berger: move client_read methods to respective channel classes
15:38 good_news_everyon mojo/channel_jberger_4 04f4a60 Joel Berger: move lots of client functionality over to the channel
15:38 good_news_everyon left #mojo
15:38 bpmedley vicash : http://mojolicious.org/perldoc/Mojolicious/Guides/Routing#Named-routes
15:39 vicash jberger, bpmedley: so to summarize, if I want to redirect to another controller's route by name, I have to create a unique name for that route or use the actual full route path.
15:39 jberger vicash: yes
15:40 jberger the nice thing about routing by name is if you decide to change the path but not the name and you've routed everything by name, then you don't have to rewrite all the referenced code
15:40 jberger plus its good for mounting to locations deeper than /
15:41 vicash ok yes that makes sense. and then the name can be set in the high level startup() function using the name() call and that's it.
15:42 jberger yep
15:42 vicash jberger, bpmedley: what is the difference (or is there any besides convenience) to use a route like to(controller => 'Login', action =>  'index') vs to("login#index") ?
15:42 jberger no difference, its just a shortcut
15:42 vicash ok
15:43 vicash ok, so far i think i am in a good spot. thank you jberger, bpmedley for your help. i'll be back with more questions as I explore more in time...
15:44 jberger np
15:44 jberger have fun
15:44 vicash bpmedley: that example should be in the docs ! it is useful..
15:53 sue joined #mojo
15:56 good_news_everyon joined #mojo
15:56 good_news_everyon [mojo] jhthorsen created channels/basic (+1 new commit): http://git.io/vu58D
15:56 good_news_everyon mojo/channels/basic 5fc5e65 Jan Henning Thorsen: Created Mojo::Channel::{WebSocket,HTTP}, ::Client and ::Server
15:56 good_news_everyon left #mojo
15:57 jontaylor joined #mojo
15:59 jontaylor joined #mojo
16:06 sri lets see
16:06 sri hmm, i don't like that
16:06 sri Mojo::Channel is missing
16:07 sri and i think the objects should already be used in Mojo::UserAgent and Mojo::Server::Daemon
16:07 sri and the docs are distracting
16:08 sri also batman style, not mojo core style ;p
16:09 sri yea, i've had a very specific expectation :)
16:12 * sri will give it a try too
16:17 jberger just keep adding commits
16:18 sh4 joined #mojo
16:20 good_news_everyon joined #mojo
16:20 good_news_everyon [mojo] jberger created channels/jberger (+1 new commit): http://git.io/vu5u8
16:20 good_news_everyon mojo/channels/jberger ab504ce Joel Berger: include Mojo::Channel, don't include docs yet
16:20 good_news_everyon left #mojo
16:21 jberger https://github.com/kraih/mojo/pull/894
16:24 jberger added one more commit to the PR
16:24 good_news_everyon joined #mojo
16:24 good_news_everyon [mojo] jberger pushed 1 new commit to channels/jberger: http://git.io/vu5zu
16:24 good_news_everyon mojo/channels/jberger f9e419c Joel Berger: also use the channel objects in the likely places
16:24 good_news_everyon left #mojo
16:25 jberger sri ^^
16:27 jberger actually, here's a big question that will shape this discussion
16:28 jberger should the ioloop actually be on the channel or the transaction
16:29 jberger no, the more I think about it, it has to be the channel
16:29 jberger moment of mental weakness
16:30 sue joined #mojo
16:34 jberger sri: regarding the name of Mojo::Channel::HTTP::Client::start
16:34 jberger perhaps it should just be an accessor-like method
16:34 jberger called tx
16:34 jberger but with the added feature that for the setter you can pass two arguments, tx and cb
16:35 jberger the getter just returns tx (public)
16:35 sri seems ugly
16:35 jberger ok, just spitballing
16:35 jberger can I merge my PR? thoughts?
16:35 sri i'm working on a separate branch atm
16:36 sri specifically the transition from http to websocket channel
16:36 jberger does it conflict with mine?
16:37 jberger sigh, travis is mad about pod tests
16:37 sri dunno, i work on client and server at the same time
16:38 sri it doesn't actually "just work" for the server
16:38 sri there's a timeout test failing if i change the class :)
16:39 jberger you mean rebless?
16:39 sri no
16:39 sri just ->new
16:41 jberger can you make an intermediate commit to say channels/sri and push so I can see?
16:41 jberger we can squash things later
16:43 good_news_everyon joined #mojo
16:43 good_news_everyon [mojo] kraih created channels/sri (+1 new commit): http://git.io/vu5wN
16:43 good_news_everyon mojo/channels/sri 4324a82 Sebastian Riedel: channel basics
16:43 good_news_everyon left #mojo
16:43 batman sri: just out of curiosity -- what was not mojo core about the doc i created?
16:43 * batman tried to mimic mojo core
16:44 good_news_everyon joined #mojo
16:44 good_news_everyon [mojo] kraih pushed 1 new commit to channels/sri: http://git.io/vu5rO
16:44 good_news_everyon mojo/channels/sri 1fb9fb8 Sebastian Riedel: remove some debug code
16:44 good_news_everyon left #mojo
16:44 sri batman: i mean the way you leave a newline between the package declaration and the use Mojo::Base
16:44 sri to me the package declaration and inheritance have the same weight, so i don't leave a newline
16:45 batman ah! i see.
16:45 batman never noticed that before :)
16:45 sri if i could i would put them on the same line
16:45 * batman just checked Mojo::Base and Mojo::Transaction to see the difference
16:45 sri like in ruby
16:45 jberger if I may suggest, lets try not to care too much about style yet
16:45 jberger we can perltidy the whole PR later
16:46 batman jberger: +1
16:46 sri "class Cat < Mammal"
16:47 sri anyway
16:48 sri jberger: that breaks a test https://github.com/kraih/mojo/commit/4324a827b23c#diff-876c5a156d62d5cb77141b6ad8276063R133
16:48 sri if you reset it to "$c->{tx} = $ws" the test works again
16:48 jberger that's surprising
16:49 sri yea
16:50 jberger for now, maybe commit what works, add a TODO comment? and I can branch from there
16:50 sri i'll try tracking it down
16:50 jberger I'd like to maintain something like a "hackathon master" which we can keep merging into/rebasing from
16:50 jberger ok
16:50 sri you'll stumble about it too in the future i imagine
16:51 jberger I'm sure
16:51 jberger I really haven't looked at the server side very much
16:57 sri i think you have to look at both sides
16:57 sri to get the abstraction right
16:57 sri server side is much easier though
16:58 jberger sure
16:59 jberger I think I'm comfortable saying that Mojo::Channel should have the ioloop accessor if we want to add that right away
17:00 batman jberger: could the attribute be private for now?
17:00 sri funny thing, the server side doesn't really need an ioloop accessor :)
17:01 jberger hmmm
17:01 sri batman: why private?
17:01 jberger well, just leave it as member data for now then
17:01 sri batman: that doesn't make any sense, we access it from the outside in Mojo::UserAgent
17:02 batman sri: from my fast readthrough it sounds a bit strange to have the ioloop in the class...
17:02 jberger yeah, it has to be public at some level
17:02 batman but i'm probably missing out on something
17:02 batman sri: right.
17:02 jberger batman: it was part of an earlier part of the refactor
17:02 * batman goes away
17:02 batman :)
17:02 jberger the useragent no longer has two queues, blocking and nonblocking
17:03 jberger it just has queues based on ioloop
17:03 jberger which was a precurser to this refactor
17:06 sri ah, found the problem :)
17:07 sri closure was capturing the old $c
17:07 sri this is a bug in master
17:08 jberger it had to be an errant closure
17:08 jberger fix on master and rebase?
17:08 sri i will
17:08 jberger cool
17:11 sri dammit
17:11 sri the fix is so verbose
17:11 sri 4 lines :O
17:11 jberger we'll get em back later
17:14 good_news_everyon joined #mojo
17:14 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vu51r
17:14 good_news_everyon mojo/master aa7c750 Sebastian Riedel: do not capture the connection
17:14 good_news_everyon left #mojo
17:15 jberger sri: wow, good catch
17:16 jberger we should be on the lookout for others like that
17:20 sri haha, i broke my branch completely
17:20 jberger :o
17:20 jberger with that fix?
17:21 sri naah, messed up merge conflicts
17:21 jberger oh
17:22 batman just a minor comment... could we call the channel object $ch instead of just $c ..?
17:22 sri oh well, at least it works
17:22 sri you can safely do what i tried in my branch
17:22 sri the http -> websocket transition is smooth now
17:23 sri batman: why $ch?
17:23 sri i have never seen $ch used for referring to a channel
17:23 jberger I'm assuming vs controller
17:23 batman i'm so used to reading $c as controller :/
17:23 jberger batman: that's been in the code for quite a while though
17:23 sri it already uses $c for the connection
17:23 sri yea
17:23 sri since like 2008
17:23 jberger its not that hard once you get in
17:24 jberger there are no controllers her
17:24 jberger here
17:24 batman yeah, but since you are rewriting it anyway :)
17:24 sri for the record, i don't like $ch
17:24 batman never wanted to suggest a big diff just for variable name change until now :)
17:24 batman no problem. just a suggestion :)
17:25 sri if it was a commonly used abbreviation, sure
17:25 jberger in the us, ch is used for channel in regards to tv
17:25 jberger "tune to ch 5"
17:25 batman nevermind. don't use time on this :)
17:25 jberger batman: agreed
17:26 jberger my language comment was just for completeness
17:26 sri yea, wasn't batman the first to tell us not to worry about style questions?
17:26 jberger no, that was me, but he agreed
17:26 jberger lawyered
17:27 jberger ok I'm going to close my now very obsolete pr
17:27 jberger probably nuke its branch too
17:27 sri http://3.bp.blogspot.com/_WwuuFlhlZSg/TONscXO1XgI/AAAAAAAAAM8/EfLEorEhAe4/s1600/chewbacca_defense.jpg
17:27 jberger sri once your rebase is ready, I propose we call that channels/master
17:27 dustinm joined #mojo
17:28 good_news_everyon joined #mojo
17:28 good_news_everyon [mojo] jberger deleted channels/jberger at f9e419c: http://git.io/vu59I
17:28 good_news_everyon left #mojo
17:29 lluad joined #mojo
17:31 sri just a minute
17:35 sue joined #mojo
17:38 good_news_everyon joined #mojo
17:38 good_news_everyon [mojo] kraih created channels/master (+1 new commit): http://git.io/vu57e
17:38 good_news_everyon mojo/channels/master 9fa69c4 Sebastian Riedel: channel basics
17:38 good_news_everyon left #mojo
17:38 sri ok, that should work as a foundation
17:41 * sri pokes jberger
17:42 jberger oops
17:42 * jberger looks
17:42 sri jus the doc tests fail (of course)
17:42 jberger should we turn of TEST_POD in the branch for now?
17:43 jberger off
17:43 sri hmm, might be helpful i guess
17:43 sri just need to remember to turn it back on
17:45 jberger batman: for a sake of cleanliness, I'm going to delete channels/basic too ok?
17:46 good_news_everyon joined #mojo
17:46 good_news_everyon [mojo] kraih deleted channels/sri at 1fb9fb8: http://git.io/vu5dR
17:46 good_news_everyon left #mojo
17:46 good_news_everyon joined #mojo
17:46 good_news_everyon [mojo] jberger deleted channels/basic at 5fc5e65: http://git.io/vu5d1
17:46 good_news_everyon left #mojo
17:46 jberger ok sri, where to next?
17:47 * sri shrugs
17:47 jberger my first port was HTTP::client_read
17:47 sri sure
17:47 jberger https://github.com/kraih/mojo/commit/62ad0a00ca39c541dd318e1899d317f68bded674
17:47 jberger that's from channel_jberger_4
17:48 sri looks good
17:48 jberger yeah its not too hard
17:48 sri $tx->{state} seems fine for now too
17:49 sri allright, so, you start a new branch based on channels/master?
17:49 jberger I thought we were saying that we were going to move all the members to the channel?
17:49 jberger re new branch, yes that's my plan
17:49 sri branch?
17:49 sri oh, yes
17:50 jberger re $tx->{state} do we want that or $c->{state}
17:50 sri and whenever we reach a "milestone", you merge it into channels/master
17:50 jberger exactly
17:50 sri sounds good
17:50 sri i'm fine with $tx->{state} for now
17:50 * jberger starts hacking
17:51 sri once all the client_/server_ methods have been moved the state can be moved too
17:51 sri i think
17:52 sri looks like all channel classes have a ->{tx}
17:52 jberger yeah
17:53 jberger the question is how to bind a tx to the cb
17:53 sri interesting fact, Mojo::Channel::HTTP::Server starts out without one
17:53 sri tx and cb is only a client thing btw
17:53 sri and only the http client
17:54 sri websocket channel will use events exclusively
17:54 jberger ok, so lets call that ::HTTP::Client functionality then
17:54 sri yea
17:54 sri i don't mind if it's hackish for now
17:54 jberger ok
17:54 jberger I'll leave it for now
17:54 sri naming and little style changes can be done later
17:58 sri i can think of multiple solutions, so it's not really an urgent problem
17:58 sri biggest priority is to move the server_ and client_ methods
18:02 jberger should I move the parse_frame stuff?
18:02 sri to Mojo::Channel::WebSocket?
18:02 jberger yeah
18:03 sri do you need it?
18:03 jberger I'm moving the websocket read method
18:03 jberger the question is how much to move
18:03 sri ah, ok
18:03 sri just questioning it because there's tons of parse_frame tests
18:03 jberger I can just point that call back to the tx
18:03 jberger ok, for now I'll leave it
18:04 sri ultimately, yes, it should move
18:05 sri i was even considering a Mojo::WebSocket module with exportable functions
18:06 sri Mojo::WebSocket::parse_frame(\$buffer, $max_websocket_size)
18:06 sri but it's a lot of grunt work
18:07 jberger for porting purposes we can alias the methods eventually
18:07 jberger but I'm just pointing back to the tx
18:11 batman sri: i'm up for Mojo::WebSocket grunt work... but maybe not is not the time?
18:12 batman i mean: better to keep the change minimal..?
18:14 jberger I'm losing some strong reference somewhere
18:18 jberger ah found it
18:18 jberger actually, I'm kinda surprised your branch passes sri
18:19 sri my branch doesn't really do anything
18:20 good_news_everyon joined #mojo
18:20 good_news_everyon [mojo] jberger created channels/jberger (+1 new commit): http://git.io/vudvP
18:20 good_news_everyon mojo/channels/jberger ed1bcf9 Joel Berger: move the client_read methods to respective Channel classes
18:20 good_news_everyon left #mojo
18:20 jberger I'll show you what I mean
18:20 jberger https://github.com/kraih/mojo/commit/ed1bcf928bb9#diff-955b07afef3c0b8632a50118b370262cR248
18:21 jberger it reads the leftovers into the wrong tx it seems
18:22 sri your branch is different from mine
18:22 sri i don't see a problem
18:22 jberger is it ok to call that $ws in that local scope?
18:23 jberger that's not going to be confusing?
18:23 sri what is wrong with my branch?
18:23 Phil21 so if I buy takeout for everyone during these, you all work on my features first right?
18:23 sri $new and $old should be just fine
18:23 jberger $new and old are transactions
18:23 jberger $c and $ws are Channels
18:24 sri Phil21: i'm totally bribeable
18:24 jberger oh I see why yours is different than mine, brainfart
18:25 Phil21 sri: I'm sure we'll speak soon enough :)
18:27 jberger sri: ok so should I merge that?
18:27 sri btw. if anyone has gandi.net credit flying around, i learned yesterday that the mojolicious domains registered there can be renewed from any gandi account :o
18:28 jberger sri: is that for mojolicio.us?
18:28 sri and mojolicious.org
18:28 jberger I don't use gandi, but I can
18:28 Phil21 I actually do use gandi
18:29 Phil21 although I'm annoyed with them
18:29 sri jberger: independent of the legal thing
18:29 Phil21 they moved all US accounts to... some new US entity they created
18:29 Phil21 and I'm annoyed, because that's half the reason I chose them
18:29 Phil21 no, I really don't care if I have to pay in euros :)
18:30 batman sri: i got a gandi account
18:30 jberger I used hover for jberger.pl and noip for joel-berger.com
18:30 batman do you want me to do anything?
18:31 sri batman: thanks, no
18:31 batman ok
18:31 sri just meant if anyone here has cretit lying around in their account and doesn't know what to do with it :)
18:32 jberger sri: shall I merge?
18:32 jberger do you have other questions?
18:32 batman sri: i got cash on my account...
18:32 jberger I guess I can PR
18:32 sri jberger: *shrug*
18:32 Phil21 well, added one year to .org
18:33 Phil21 least I can do
18:33 Phil21 as soon as the bitcoin payment gets validated, at least
18:33 sri Phil21++
18:33 sri jberger: looks ok i guess
18:35 good_news_everyon joined #mojo
18:35 good_news_everyon [mojo] jberger pushed 1 new commit to channels/master: http://git.io/vudTr
18:35 good_news_everyon mojo/channels/master 270a5f3 Joel Berger: Merge pull request #895 from kraih/channels/jberger...
18:35 good_news_everyon left #mojo
18:35 batman didn't know we could still use the .us domain...
18:35 * sri is ashamed to admit that before gandi he actually used godaddy
18:35 * batman as well :(
18:36 jberger so the next commit to jberger_4 is this one https://github.com/kraih/mojo/commit/04f4a60b4867dfecb00810a7dcaea3a5f5351f12
18:36 jberger its the client_write
18:37 jberger and its where things start to get interesting
18:37 Grinnz i used godaddy too. i switched to namecheap on "godaddy day" and then to google domains, hehe
18:38 Grinnz nothing wrong with namecheap, but google domains has free private whois
18:38 jberger hover sponsors the hello internet podcast, so I used them for jberger.pl
18:38 jberger its as good of a reason as I could find
18:39 sri jberger: might be worth removing the docs for the methods you remove too
18:39 sri finding them later might be annoying
18:41 vicash hello. in `perldoc Mojolicious::Controller` the session() method takes either 'expiration' or 'expires'. What is the default value of expiration ? is it 0 ?
18:41 jberger sri: good idea
18:42 bpmedley vicash : https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Sessions.pm#L10
18:42 jberger sri: also if you want to take the lead hacking for a bit, I need to do one quick thing in the real world and then have lunch
18:43 sri don't think i've thought about the next steps enough to do much
18:43 vicash bpmedley: thanks. that's the doc I wanted!
18:43 sri but i'll look at your next patch
18:44 jberger read over that commit I linked to, its my general next step
18:44 jberger the questions were the data member locations and emitting the transaction events
18:44 jberger I think we decided that the channel is going to subscribe to resume
18:44 sri right
18:45 KindOne joined #mojo
18:45 sri seems reasonable so far
18:46 sri jberger: haha, you also follow the batman school of class layouts
18:47 sri NO MORE LINEBREAKS!!!
18:47 batman haha
18:47 batman welcome to the dark side. we have line breaks.
18:47 batman ;)
18:48 sri you know, i wish i could say "package Mojo::Channel::HTTP is Mojo::Channel"
18:49 batman yeah. never thought about that before, but it's weird that parent/base/whatever isn't in core (and part of package)
18:49 sri base and parent are in core
18:49 batman nevermind the parentheses :(
18:50 batman yeah. bad wording.
18:50 batman never understood why it's so hard to inherit :(
18:50 sri "package Mojo::Channel::WebSocket parent('Mojo::Channel')"
18:51 sri dunno, can't think of a nice syntax for a use statement in the package line
18:52 sri well, i think it's pretty clear why it's not more native, things just evolved that way over the years
18:52 sri when you're just starting out with developing an OO system, making it pluggable with stuff like @ISA, makes perfect sense
18:53 batman not sure... they managed to get version into package ...;, so why not "is" or whatever?
18:53 batman or even package foo < bar;
18:53 ribasushi because inheritance has fallen out of favor
18:53 sri i don't think that's true, at least for single inheritance
18:53 batman ribasushi: i don't undestand "fallen out of favor"
18:53 ribasushi ( whether that in itself is sane or not is a sep. matter )
18:54 ribasushi there is a tangible push towards roles, which is essentially "individual Stash composition from various free-floating coderefs"
18:55 ribasushi it's not that the concept are incompatible, it's that the Moose folk want them to be
18:55 batman ribasushi: sure. but i still think inheritance makes sense
18:55 ribasushi batman: I am not saying it doesn't, I am trying to explain why core is not embracing it more
18:55 batman thanks ribasushi
18:55 ribasushi also note my "whether it is sane is another matter" line ;)
18:55 batman hehe
18:56 PryMar56 joined #mojo
18:56 ribasushi also this is all conjecture based on my own observations, might be entirely bogus
18:57 sri single inheritance, roles, and delegation... i like them all for different use cases
18:57 batman +1
18:57 ribasushi absolutely
18:57 batman ribasushi: i won't hold it against you ;)
18:57 batman hehe
18:58 ribasushi sri: fun fact re "building an OO system"
18:58 ribasushi when 5.0 shipped (with @ISA etc already baked)
18:58 ribasushi it was *another year* before Java 1.0 came out
18:58 ribasushi i.e. there was very little mainstream OO usage to start with (aside from C++, which is bizarre in its own way)
18:58 ribasushi no "lessons learned" etc
18:58 sri bottom line, stop adding linebreaks between the package declaration and @ISA manipulation batman! :)
19:00 batman sri: am i doing @ISA manipulation..?
19:00 sri batman: well, "use Mojo::Bae 'Mojo::Channel'"
19:00 sri hehe, mojo is bae
19:00 patrickz joined #mojo
19:00 batman anyway... i think i will stop adding linebreaks in all cases for my own modules
19:01 batman i don't like to have line breaks between "use"
19:03 sri i always split up normal imports and pragmas i think
19:04 sri "package declaration + inheritance > pragmas > imports > constants > attributes > class variables > methods"
19:08 stephan48 you put package declaration and inheritance on the same line or like "package ...;\nuse Mojo::Bae '...';\n\n... rest"?
19:09 sri second
19:09 batman i wonder if it's possible to change "package" without using the "package" keyword...
19:10 sri stephan48: https://github.com/kraih/mojo/blob/master/lib/Mojo/Transaction/HTTP.pm#L1
19:10 stephan48 thanks, was too lazy to visit the repo :)
19:10 sri -.-
19:10 sri i look at it as a class declaration block
19:11 batman sri: what do you do about read-only attributes? are they always listed in the METHODS section?
19:11 sri batman: nope
19:11 batman do you declare them with sub{} or has ?
19:12 sri i just don't make those attributes
19:12 batman ok, hehe
19:17 sri batman: so, did you learn how the user agent works yet? :)
19:18 jberger home project done (getting ready for the snowstorm we are about to get) time for lunch
19:18 jberger back soonish
19:19 batman sri: i don't completely follow the proxy connections.
19:19 batman i think i get the rest.
19:20 sri yea, proxy is the hardest part
19:21 good_news_everyon joined #mojo
19:21 good_news_everyon [mojo] kraih pushed 1 new commit to channels/master: http://git.io/vudcH
19:21 good_news_everyon mojo/channels/master 419bf40 Sebastian Riedel: all client_read methods have been removed
19:21 good_news_everyon left #mojo
19:21 sri jberger: only managed to do some cleanups
19:22 batman is proxy relevant for the refactor?
19:22 sri batman: nope
19:22 sri proxy is a little complicated because there's 3 different kinds
19:23 sri first you have the normal http proxy, where you send a full absolute url in the request line, that's completely managed by Mojo::Message
19:23 sri then you have socks5, which is handled transparently by Mojo::IOLoop::Client
19:23 batman what i was trying to figure out now is how max_connections work... but it made my head spin a bit :/
19:24 batman not sure what's going on, but i've been very tired lately...
19:24 batman maybe it's because i get tired of thinking about assetpack :(
19:24 sri and finally the hardest, CONNECT, where you establish a connection to the proxy, perform a CONNECT request, and then get connected to the real server, that's what _connect_proxy in Mojo::UserAgent does
19:24 sri CONNECT is used for HTTPS, WS and WSS
19:26 sri batman: max_connections is super easy, we just limit the number of keep-alive connection in the queue with it https://github.com/kraih/mojo/blob/master/lib/Mojo/UserAgent.pm#L285
19:26 batman yeah, but it looked like the while loop was killing old connections as well...
19:26 * batman will look again
19:26 sri and connections go into the queue when they can be kept-alive, and there is no open transaction on the connection
19:27 sri yes, it kills connections defensively, just in case
19:27 sri i like removing old connections and keeping the newer ones
19:30 sri i bet nobody understands this part :) https://github.com/kraih/mojo/blob/master/lib/Mojo/UserAgent.pm#L140-L145
19:31 sri that's the funny case where you perform a CONNECT request to a proxy over HTTP, and then have to negotiate TLS, before you can speal HTTPS with the real target
19:31 sri s/l/k/
19:32 batman i either don't understand that at all or understand it a whole lot better than max_connections :)
19:33 sri haha, the keep-alive queue is really super simple ;p
19:34 sri only tricky bit is the $stream->is_readable check https://github.com/kraih/mojo/blob/master/lib/Mojo/UserAgent.pm#L204
19:34 batman $ua->get($url, sub {...}) for 1..10; # so the first five will start, while the next five requests are put into a queue?
19:34 sri no requests are ever put in a queue
19:34 sri we don't limit concurrent requests
19:35 sri only how many connections we keep alive after the requests are finished
19:35 sri if you make than 1..1000 you get 1000 connections
19:35 sri s/n/t/
19:36 Grinnz_ joined #mojo
19:37 batman ah. right. _enqueue is called from _remvoe
19:37 batman *_remove
19:37 sri yea
19:38 batman i think i complicated things by thinking about the word "queue"...
19:39 batman thanks
19:46 good_news_everyon joined #mojo
19:46 good_news_everyon [mojo] kraih pushed 1 new commit to channels/master: http://git.io/vudRp
19:46 good_news_everyon mojo/channels/master c7cd1af Sebastian Riedel: move server_read methods as well
19:46 good_news_everyon left #mojo
19:46 sri jberger: actually, i've moved server_read as well, was pretty obvious
19:47 sri you take point on the write methods now :)
19:47 sri that's too hard for me
19:48 jberger perfect timing
19:48 jberger just got back
19:49 jberger its raining decently hard and hovering about about 1C
19:49 jberger whenever the temp drops this becomes a blizzard
19:50 sri we've had lots of snow the last few days, now it's all melting outside
19:50 jberger hopefully we don't get the raining ice thing that we had a couple weeks back
19:50 jberger that was terrible
19:50 jberger we got about 6 inches of tiny ice pellets
19:51 jberger they approximated snow but were damn near impossible to move
19:51 sri Mojo::Transaction::HTTP is pretty straightforward
19:52 sri Mojo::Transaction::WebSocket is more quirky, with the handshake stuff
19:52 * jberger pulls
19:53 sri liek this, which we'll have to redesign a little https://github.com/kraih/mojo/blob/master/lib/Mojo/UserAgent/Transactor.pm#L147
19:53 sri that really doesn't have to be a client_* thingy
19:53 jberger ah interesting
19:53 jberger I hadn't identified that spot yet
19:54 sri client_handshake and client_challenge
19:54 sri those can totally be utility functions from a Mojo::WebSocket package
19:54 jberger oh weird, that transaction isn't stored at all
19:55 sri yea
19:55 sri it's just generic utility
19:55 jberger is that the same for the frame parsing?
19:55 jberger does the parse depend on the instance object at all?
19:55 sri frame parsing/building methods are mostly clean and easy to extract
19:56 sri client_challenge actually touches $self->compressed
19:56 jberger I'm just trying to imagine what could be extracted
19:56 punter joined #mojo
19:56 sri parse_frame/build_frame will be plain utility functions i think
19:57 sri just updating the frame tests will be annoying
19:57 sri otherwise, super easy
19:57 jberger batman: does that sound like a thing you could work on?
19:57 * jberger lights the bat signal
19:58 sri hmm, actually, client_challenge is fine too
19:58 sri maybe i will try extracting that first
19:58 jberger go ahead
19:58 sri batman could take over afterwards with the parse_frame/build_frame stuff
19:58 jberger I'm working on http write
19:58 jberger client
19:59 sri allright
19:59 patrickz joined #mojo
20:00 jberger sri: from my old patch, did you think it was sane to put the write stuff into the HTTP base class the way I did?
20:00 sri hmm, i need a new name for client_handshake and server_handshake
20:01 sri jberger: don't remember
20:01 jberger if you read it and didn't hate it then that ok in my book
20:01 sri ¯\_(ツ)_/¯
20:02 jberger actually, since we are doing client and server at the same time, this might be nice
20:04 batman i can work on Mojo::WebSocket. the task is to make utility functions right..?
20:05 Phil21 jberger: it's gonna probably get cold in ~24hrs
20:05 Phil21 since it's dropping like a rock here now
20:05 batman jberger, sri: should i wait or not..? and which branch should i start from?
20:05 jberger branch from channels/master
20:05 sri batman: wait a bit
20:05 Phil21 going to be around -22C tonight
20:05 jberger Phil21: :s
20:05 Phil21 that will eventually come hit you :)
20:05 batman sri: ok. let me know.
20:05 sri batman: i'm creating Mojo::WebSocket with the handshake stuff
20:06 batman cool
20:06 sri batman: you take over for the frame handling :)
20:06 sri will poke you in like 20-30 mins
20:06 batman just mention me, and i'll start...
20:16 mohij joined #mojo
20:18 punter joined #mojo
20:25 good_news_everyon joined #mojo
20:25 good_news_everyon [mojo] kraih pushed 1 new commit to channels/master: http://git.io/vudo0
20:25 good_news_everyon mojo/channels/master 4b74d88 Sebastian Riedel: add Mojo::WebSocket for low-level protocol functions
20:25 good_news_everyon left #mojo
20:25 sri batman, jberger: review ;p
20:25 sri the names are not final
20:25 sri just couldn't think of anything better
20:26 jberger what is {masked}?
20:26 sri frames sent from the client to the server get xor masked
20:27 sri some security nonsense
20:27 batman sri: which names don't you like?
20:27 sri so, if masking is active, we know we are the client
20:27 sri batman: all
20:29 sri batman: you'll need to pass the max_websocket_size value as an argument to parse_frame btw.
20:29 sri that's the only complicated part
20:29 batman what do we gain by adding Mojo::WebSocket..?
20:29 sri better abstraction
20:29 batman ok
20:29 sri better testing i imagine
20:30 jberger batman: generally we are trying to dramatically reduce the scope/duties of ::Transaction classes
20:30 sri HTTP2 will get a Mojo::HTTP2 namespace too, with utilities
20:31 batman i see. thanks
20:31 sri i wouldn't feel terrible if those utilities end up in Mojo::Channel::WebSocket, but i think this makes more sense
20:31 * batman gets cracking
20:31 sri because modules like Mojo::UserAgent::Transactor actually use challenge()
20:32 jberger I still don't completely understand where {masked} comes from, but the rest looks good
20:32 jberger I don't mind the names tbh
20:32 sri batman: don't get a shock when you see t/mojo/websocket_frames.t :)
20:32 sri it's a lot of tests that need updating
20:32 batman :D
20:33 batman thanks... i think the glass of wine will help me get by...
20:33 batman :P
20:33 sri jberger: here :) https://github.com/kraih/mojo/blob/master/lib/Mojo/UserAgent/Transactor.pm#L130
20:34 jberger hmmmm, ok
20:34 batman i wonder if the code would be easier to read if the exported functions had the prefix ws_, but i guess it will look pretty stupid with Mojo::WebSocket::ws_xxx
20:34 batman challenge() vs ws_challenge()
20:34 sri batman: yea, Mojo::Loader and Mojo::Util also don't have a prefix
20:34 batman sri: but the functions are more... unique imo
20:34 sri not that i'm opposed, even websocket_challenge makes sense
20:35 batman s/the/those/
20:35 sri it's more about client_handshake and server_handshake
20:35 sri websocket_server_handshake
20:37 batman either that or ws_ if it makes perltidy more happy :)
20:37 batman (thinking about line length)
20:37 sri i've just been thinking if client_handshake and server_handshake could be merged into websocket_handshake :)
20:38 batman sri: i will have a look.
20:38 sri well, we've got time
20:38 batman please continue on some other issue...
20:38 sri getting names right is for later
20:38 batman i'll make a channels/ws branch which you guys can review
20:40 jberger in moving the write methods, any idea why I'm getting Can't locate object method "send" via package "Mojo::Transaction::HTTP" at t/mojo/websocket_proxy.t line 134
20:40 jberger clearly something isn't upgrading correctly
20:40 sri was about to say
20:40 jberger and I'm also getting keep-alive test failures
20:40 jberger at least this is consistent with my previous branch
20:42 sri this is more productive than the mojoconf hackathon ;p
20:46 good_news_everyon joined #mojo
20:46 good_news_everyon [mojo] jberger pushed 1 new commit to channels/jberger: http://git.io/vudP5
20:46 good_news_everyon mojo/channels/jberger db4377e Joel Berger: partial move of _write methods...
20:46 good_news_everyon left #mojo
20:47 jberger https://github.com/kraih/mojo/compare/channels/master...channels/jberger
20:47 jberger I think it helps when there are a few parameters to a hackathon
20:48 jberger next mojoconf, we should have a few topics pre-planned
20:48 jberger probably with topic leaders
20:48 jberger anyway, sri, can you help me try to figure out what's up with that ^^
20:48 jberger its basically where I got stuck before
20:50 sri let see
20:52 * batman moves build_frame() as well
20:54 sri jberger: so, it looks like it is the user agent
20:54 sri daemon works fine
20:54 sri and, it looks like you have some state problem, because the first request works
20:54 sri the second blocks forever
20:55 * jberger digs
20:56 sri looks like there is an empty write on the second request
20:56 jontaylor joined #mojo
20:57 sri so, should be somewhere around Mojo::Channel::HTTP::Client::write
20:57 jberger there is only Mojo::Channel::HTTP::write
20:57 sri maybe a buffer not getting reset
20:57 jberger probably
20:57 sri you have to take into account that the channel is reused
20:57 sri while the transaction before was not
20:57 sri i bet on some $self->{...} state
20:58 jberger yah, that's it
20:58 jberger https://github.com/kraih/mojo/compare/channels/master...channels/jberger#diff-aaa800bb78224b7d68d38d55aa066ac4R16
20:58 sri \o/
20:58 jberger what do I do about it?
20:59 jberger put that state back into the tx?
20:59 sri for now, yea
20:59 jberger hmmmm
20:59 sri we'll have to move that to the channel later, and make sure it is cleared for each new request
20:59 jberger but basically all of these will have to be reset
21:00 sri ye
21:00 jberger I'd almost rather just have a reset method
21:00 jberger which could be the same time you add a new tx
21:01 sri sure
21:01 sri although, i'd rather hide state from the outside
21:01 sri channel should end up as a bit of a black box
21:01 sri so adding new protocols becomes easier later
21:01 jberger ->start($tx => $cb) resets all the channel state
21:02 sri ye, something like that
21:02 jberger or whatever we call the method
21:03 sri talking about chicago :D http://www.theonion.com/article/chicago-police-department-monitor-all-interactions-52136
21:04 jberger hehe
21:04 jberger remember I'm in the suburbs and I'm white, so I'm safe
21:04 jberger (gods I wish that was more of a joke than it really is)
21:09 sri looks like there is not that much state remaining in the transaction classes themselves
21:09 sri the open/close stuff
21:12 sri umm
21:12 sri wow
21:12 sri i was just running some benchmarks against the branch
21:12 sri to see how much performance it will cost us... and it turns out channels/master is a little faster than master Oo
21:15 batman hm... all tests are ok, except t/mojolicious/websocket_lite_app.t :(
21:15 * batman will dig some more
21:19 jberger well I think this helped but I'm still having an upgrade problem
21:19 jberger Can't locate object method "is_established" via package "Mojo::Transaction::HTTP" at t/mojo/websocket.t line 167
21:22 patrickz joined #mojo
21:24 sue joined #mojo
21:30 jberger I'm this close to pushing all the state back into the transaction
21:30 jberger :(
21:36 sri why?
21:37 jberger because I couldn't track it down
21:37 good_news_everyon joined #mojo
21:37 good_news_everyon [mojo] jberger pushed 1 new commit to channels/jberger: http://git.io/vudbS
21:37 good_news_everyon mojo/channels/jberger 30496cf Joel Berger: moved state back into transaction...
21:37 good_news_everyon left #mojo
21:37 jberger stuff kept breaking
21:37 jberger :s
21:37 jberger that worked though
21:37 jberger just more to clean up later
21:38 sri that was to be expected
21:39 sri it should get easier once everything that can be moved has been moved
21:39 jberger yeah
21:39 jberger then we'll start looking for encapsulation violations and it should clear up
21:40 sri ye
21:40 jberger another possibility might just be to have a scratchpad that the channel keeps with the transaction
21:41 sri naah
21:41 good_news_everyon joined #mojo
21:41 good_news_everyon [mojo] jhthorsen created channels/ws (+2 new commits): http://git.io/vudN1
21:41 good_news_everyon mojo/channels/ws fa241ba Jan Henning Thorsen: Add Mojo::WebSocket::parse_frame()
21:41 good_news_everyon mojo/channels/ws 90c6d74 Jan Henning Thorsen: Add Mojo::WebSocket::build_frame()
21:41 good_news_everyon left #mojo
21:41 batman so... i'm still working on build_message()
21:41 batman but please let me know what you think
21:43 sri not sure build_message should move
21:43 jberger I'm gonna squash my branch and merge it into channels/master
21:43 sri it's higher level
21:43 batman sri: ok. what about the rest?
21:43 batman please cherry-pick what makes sense or let me know what's wrong
21:43 sri -1 on MAX_WEBSOCKET_SIZE
21:44 batman why?
21:44 sri why is it there?
21:44 good_news_everyon joined #mojo
21:44 good_news_everyon [mojo] jberger pushed 1 new commit to channels/master: http://git.io/vudAB
21:44 good_news_everyon mojo/channels/master 8082f45 Joel Berger: move the _write methods to the channel classes
21:44 good_news_everyon left #mojo
21:44 batman the same number is used in Mojo::Transaction::WebSocket and Mojo::WebSocket
21:44 sri you added it, you have to defend it ;p
21:45 sri it's not a special constant
21:45 jberger meaning, you have to pass it by value?
21:45 batman i guess we could just copy/paste 262144, but i'm not a big fan of that...
21:45 batman we could also require it as input to parse_frame()
21:46 sri oh, i didn't see that it wasn't required
21:46 batman https://github.com/kraih/mojo/compare/fa241bae873c%5E...90c6d746934d#diff-3a31e55268a74241090ee85520e7303cR91
21:46 sri it should 100% be required
21:46 batman ok. i'll change it.
21:47 sri what is that https://github.com/kraih/mojo/compare/fa241bae873c%5E...90c6d746934d#diff-05994dec4906bf28acff4ad90c1c0cbfR134
21:48 sri that seems completely wrong
21:48 sri and there's more like it
21:49 batman that looks like a bad copy/paste
21:51 good_news_everyon joined #mojo
21:51 good_news_everyon [mojo] jberger force-pushed channels/jberger from 30496cf to 8082f45: http://git.io/vudpX
21:51 good_news_everyon left #mojo
21:52 sri jberger: looks good
21:52 jberger close methods next
21:52 sri should be easy
21:53 jberger well this is where the events start showing up
21:54 sri i already see $tx->emit(...) calls
21:55 * batman dislike isnt() tests :(
21:55 sri maybe we can get rid of more events
21:55 jberger yeah, we're already going to have to figure those out later
21:55 sri like upgrade, which was just legacy someone forgot to remove
21:58 sri these refactorings are a good way to smuggle backdoors into the code
21:58 sri like, no way i would notice if batman changed a few lines in parse_frame :)
22:01 jberger semantically, should there still be a close method in ::Transaction?
22:01 jberger certainly if its in the channel it wouldn't be named close
22:01 jberger close_tx or something
22:01 sri well, do we need it?
22:02 sri there is no close method in master
22:03 good_news_everyon joined #mojo
22:03 good_news_everyon [mojo] jhthorsen force-pushed channels/ws from 90c6d74 to d0bc992: http://git.io/vuFey
22:03 good_news_everyon mojo/channels/ws 0599155 Jan Henning Thorsen: Add Mojo::WebSocket::build_frame()
22:03 good_news_everyon mojo/channels/ws 8e48587 Jan Henning Thorsen: Add Mojo::WebSocket::build_message()
22:03 good_news_everyon mojo/channels/ws d0bc992 Jan Henning Thorsen: $max_websocket_size is required as input to parse_frame()
22:03 good_news_everyon left #mojo
22:04 sri batman: can you squash it?
22:04 batman sri: crap. i messed up. wait a sec...
22:05 sri oh no, you added more new stuff :/
22:05 jberger sri: opinions on what to call the close methods in channel?
22:05 jberger I don't think we should call them close anymore
22:06 sri batman: for now i'd like a clean move, without new apis
22:06 jberger think about it while I continue
22:06 sri jberger: yea
22:06 sri although, there is open and close for websockets
22:06 sri at least the server needs an ->open
22:07 sri batman: we have no public constants yet, if you want to add some, please make it a new project
22:08 sri we would need documentation conventions and the like
22:09 batman sri: i said "wait a sec" :(
22:10 batman that branch is a complete mess now. not sure when i cherry-picked the last commit.
22:14 good_news_everyon joined #mojo
22:14 good_news_everyon [mojo] jhthorsen force-pushed channels/ws from d0bc992 to 61b3fdc: http://git.io/vuFey
22:14 good_news_everyon mojo/channels/ws 5134b76 Jan Henning Thorsen: Add Mojo::WebSocket::parse_frame()
22:14 good_news_everyon mojo/channels/ws 6d79b07 Jan Henning Thorsen: Add Mojo::WebSocket::build_frame()
22:14 good_news_everyon mojo/channels/ws 61b3fdc Jan Henning Thorsen: Remove public constant MAX_WEBSOCKET_SIZE
22:14 good_news_everyon left #mojo
22:15 batman sri: now.
22:15 batman are you fine with build_frame $self->masked, @$frame ?
22:15 jberger oh hey I missed removing some doc
22:15 sri batman: you forgot to squash
22:15 jberger batman: wait to squash until I push this doc change
22:16 jberger you can then rebase there
22:16 batman sri: i will rebase+squash onto channels/master when all is good
22:16 sri ok
22:16 good_news_everyon joined #mojo
22:16 good_news_everyon [mojo] jberger pushed 1 new commit to channels/master: http://git.io/vuFUJ
22:16 good_news_everyon mojo/channels/master 9e14e70 Joel Berger: remove doc for removed methods
22:16 good_news_everyon left #mojo
22:17 batman so... i'm very tired now, so i would appreciate a last run through though :/
22:17 jberger of commands to run?
22:17 jberger git fetch
22:17 jberger git rebase -i origin/channels/master
22:17 batman no. the diff :P
22:18 jberger oh ok
22:18 batman hehe :)
22:18 batman jberger: i guess you can rebase+squash my changes...
22:18 sri looks fine as far as i can see
22:18 batman ok
22:19 * batman will rebase
22:19 batman ..onto channels/master
22:19 jberger yep
22:19 jberger just be sure you pull my changes first
22:19 batman i will
22:21 good_news_everyon joined #mojo
22:21 good_news_everyon [mojo] jhthorsen pushed 1 new commit to channels/master: http://git.io/vuFTk
22:21 good_news_everyon mojo/channels/master 3a4cc39 Jan Henning Thorsen: Add Mojo::WebSocket::parse_frame() and ::build_frame()
22:21 good_news_everyon left #mojo
22:22 batman okidoki... wish i could help out more, but i'm afraid any next step will not be very good for me :(
22:22 Grinnz joined #mojo
22:25 jberger batman++ sleep well!
22:26 batman thanks :)
22:26 batman http://www.quickmeme.com/img/ae/ae1a7d9c1b2124df9af8d6cfcb81ba2837eae8920e9213a7c22afc1c92eae0bf.jpg
22:26 sri batman++ # nn, i'll clean up the stuff you forgot ;p
22:26 batman sri: thanks. sorry for missing the out
22:27 batman s/the//
22:28 batman good luck! see you tomorrow :)
22:28 jberger sri: there is server_close in Mojo/Server/CGI.pm
22:29 batman btw: jberger... can you please make sure your language has a better word for the plural version of "you"? :P
22:29 jberger I'll work on that
22:29 batman looks like i'm only writing "you" to sri, hehe :)
22:29 jberger y'all
22:29 batman ah! cool.
22:29 * batman tries to remember that
22:30 jberger its a hick term though
22:30 batman still. works on irc
22:30 jberger true
22:30 bpmedley It ain't
22:30 jberger bpmedley++
22:30 jberger bpmedley: would you prefer "country bumpkin"?
22:30 bpmedley Only if you're female
22:31 jberger hehe
22:31 sri jberger: oh right, yea, that needs a publicmethod
22:32 jberger yeah, its in the PSGI server too
22:32 jberger can/should it be renamed close?
22:32 sri guess so
22:32 sri since finish is taken
22:36 good_news_everyon joined #mojo
22:36 good_news_everyon [mojo] kraih pushed 1 new commit to channels/master: http://git.io/vuFtm
22:36 good_news_everyon mojo/channels/master 71516d1 Sebastian Riedel: slightly more consistent style
22:36 good_news_everyon left #mojo
22:37 sri for the record, i'm not at all opposed to public constants, we just need rules for how to use them
22:40 sri wow, the http transaction is so tiny now https://github.com/kraih/mojo/blob/channels/master/lib/Mojo/Transaction/HTTP.pm
22:40 sri \o/
22:41 jberger I'm thinking that Mojo::Channel::HTTP::close (and relatedly ::Server::close) should just be documented as an alias to ::Transaction::close
22:41 jberger because it helps to alleviate some cases where its annoying to get the channel object back
22:41 jberger and otherwise it seems asymmetric
22:42 sri sure
22:45 jberger and now I'm rethinking renaming server_close -> close
22:46 jberger because people are going to accidentally call it
22:46 jberger rather than finish
22:46 jberger leaving the server_ there might help prevent people from using it
22:46 sri $tx->conclude
22:46 sri :)
22:46 jberger close_YOU_REALLY_DONT_MEAN_THIS
22:46 sri nobody is going to call that
22:47 sri $tx->finalize
22:49 sri we'll need an open method on the transaction too though
22:49 jberger oh shoot
22:49 sri perhaps $tx->closed $tx->opened
22:49 jberger and the websocket transaction inherits it's client_close from the Transaction
22:49 jberger which means its shared
22:50 sri websocket has its own server_close
22:50 jberger and I can't even delegate it as $c->{tx}->handshake->close if I move the client close to the channel
22:50 jberger client
22:53 disputin joined #mojo
22:53 punter joined #mojo
23:02 jberger hmmm, I'm kinda at a loss
23:02 sri what's the problem?
23:03 jberger where do I move Mojo::Transaction::client_close?
23:04 jberger I was going to move it to Mojo::Channel::HTTP::Client::close
23:04 jberger but Mojo::Transaction::WebSocket inherits the same client_close
23:05 patrickz joined #mojo
23:05 sri aaah
23:06 sri ok, i think you can untangle that
23:06 sri that method is mostly just relevant for HTTP
23:06 sri think it's an accident that it modifies the handshake of websockets
23:07 sri just apply this https://gist.github.com/anonymous/0eba6868f2c64af665d2
23:07 jberger that I can do
23:07 jberger thanks
23:08 sri websockets only really care about an exit status, modifying the handshake is silly
23:08 sri purely accidental there i think
23:08 jberger its just hard for me to know that
23:08 jberger hackathons++
23:08 sri jberger++
23:09 sri \o/
23:09 sri glad i can help
23:09 sri some of this was not even designed, it has just grown that way
23:10 sri you wouldn't believe how bad the first few versions were
23:10 sri DO NOT LOOK IT UP!
23:10 * jberger has enough to do
23:10 sri phew
23:10 jberger you're safe (for now)
23:11 mohij joined #mojo
23:14 sri ok, so tx will be a public attribute of every channel i guess
23:14 sri client side even for http/2 it makes sense
23:16 patrickz joined #mojo
23:17 jberger ok I have a patch for porting of client_close, should I just put it to channels/master?
23:17 sri gist?
23:17 jberger no, I'll push my branch, its just as easy
23:17 sri at this point i guess you could also just push if you're sure about it
23:19 sri and i know i want a $channel->is_active method
23:19 sri there's quite a few places that check for a transaction to see if a connection is doing anything
23:19 sri or $channel->is_busy
23:20 sri most references to the transation in Mojo::Server::Daemon can be removed easily
23:20 sri +c
23:22 good_news_everyon joined #mojo
23:22 good_news_everyon [mojo] jberger pushed 1 new commit to channels/jberger: http://git.io/vuFZD
23:22 good_news_everyon mojo/channels/jberger 9d2db69 Joel Berger: move client_close to channels...
23:22 good_news_everyon left #mojo
23:23 sri "base clase"
23:23 jberger meh, its a commit message
23:23 jberger I guess I can fix it
23:24 good_news_everyon joined #mojo
23:24 good_news_everyon [mojo] jberger force-pushed channels/jberger from 9d2db69 to 79de237: http://git.io/vudpX
23:24 good_news_everyon mojo/channels/jberger 79de237 Joel Berger: move client_close to channels...
23:24 good_news_everyon left #mojo
23:25 sri oh, you didn't push to channels/master
23:25 sri looks fine
23:25 jberger ok, pull merge up
23:26 good_news_everyon joined #mojo
23:26 good_news_everyon [mojo] jberger merged channels/jberger into channels/master: http://git.io/vuFcZ
23:26 good_news_everyon left #mojo
23:27 jberger wow, its already been a pretty big day: https://github.com/kraih/mojo/compare/channels/master
23:28 sri indeed
23:29 jberger as to Mojo::Transaction::server_close I think I like the name finalize if we don't want to keep server_close as the name
23:32 sri i don't like server_close
23:32 jberger finalize? and maybe server_open becomes initialize?
23:33 jberger you know why I love this laptop
23:33 sri not a fan of initialize
23:34 jberger I unplugged when I stared hacking this morning
23:34 jberger I still have an hour of battery left
23:34 jberger \o/
23:35 jberger re server_close: the good news is that is just a name change I believe
23:35 sri i tend more towards $tx->opened/closed
23:35 jberger I think we are essentially done, now for the cleanup
23:35 sri you're not actually opening or closing somthing, you're signaling that something happened
23:36 jberger that makes sense to me
23:38 sri wait, the websocket client and server classes are really empty? :)
23:39 sri guess we might not need those
23:41 good_news_everyon joined #mojo
23:41 good_news_everyon [mojo] kraih pushed 1 new commit to channels/master: http://git.io/vuF4u
23:41 good_news_everyon mojo/channels/master 9c5b79e Sebastian Riedel: no need for multiple WebSocket classes
23:41 good_news_everyon left #mojo
23:41 sri may the cleanup begin
23:42 jberger wow, really?
23:42 jberger that's kinda odd
23:43 jberger a very symmetric channel
23:43 sri you pretty much only need to know about masking, that's it
23:43 sri and the transaction knows that
23:44 sri even if we moved the masked attribute into the channel, we still wouldn't need more classes ;p
23:44 sri well, it makes sense, the apis on both sides are pretty much equal
23:46 good_news_everyon joined #mojo
23:46 good_news_everyon [mojo] jberger pushed 1 new commit to channels/jberger: http://git.io/vuFRO
23:46 good_news_everyon mojo/channels/jberger 08325e1 Joel Berger: rename server_open -> opened and server_close -> closed
23:46 good_news_everyon left #mojo
23:46 jberger that commit is missing your recent one
23:46 jberger give it a once over and I'll rebase it into channels/master
23:47 sri the documentation is odd
23:47 jberger what would you prefer?
23:47 jberger its just the old documentation
23:47 sri something generic
23:48 sri the whole web server vs user agent thing is supposed to be gone
23:48 sri "Signal that the underlying connection has been closed" or something like that
23:49 jberger can we add something like "This is a low-level command that isn't likely to be used by end-users" or something?
23:50 sri we have somethign like that already
23:51 sri http://mojolicious.org/perldoc/Mojolicious/Routes/Route#route
23:51 jberger Low-level signal that the underlying connection has been closed
23:51 jberger ?
23:52 sri "...that the underlying connection is finished with this transaction"?
23:52 jberger do you want to update my branch and I'll squash its all up and in?
23:53 sri me? i don't want to update your branch
23:53 sri just push it to channels/master, rest looks good
23:54 sri although, we do have to do something about {state}
23:55 good_news_everyon joined #mojo
23:55 good_news_everyon [mojo] jberger pushed 1 new commit to channels/master: http://git.io/vuFuG
23:55 good_news_everyon mojo/channels/master e122bab Joel Berger: rename server_open -> opened and server_close -> closed
23:55 good_news_everyon left #mojo
23:55 jberger go ahead and reword the doc
23:58 jberger sri++ I love that mojo is so well tested, I wouldn't ever have been comfortable doing this big of a refactor without those tests

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