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

IRC log for #mojo, 2015-09-15

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

All times shown according to UTC.

Time Nick Message
00:58 dvinciguerra joined #mojo
01:06 AndroUser2 joined #mojo
01:36 jb360 joined #mojo
01:49 ashimema joined #mojo
01:53 mattastrophe joined #mojo
02:22 zivester joined #mojo
02:52 noganex_ joined #mojo
03:02 kaare joined #mojo
03:04 Grinnz sri, https://metacpan.org/release/TOKUHIROM/Perl-Build-1.12
03:33 ans joined #mojo
03:53 zivester joined #mojo
03:59 jb360 joined #mojo
05:44 berov joined #mojo
05:49 panshin joined #mojo
05:50 panshin joined #mojo
05:51 panshin joined #mojo
05:53 inokenty-w joined #mojo
05:54 dod joined #mojo
05:56 panshin joined #mojo
06:00 dod joined #mojo
06:05 dod joined #mojo
06:07 vanHoesel joined #mojo
06:25 bwf joined #mojo
06:34 melo joined #mojo
06:40 vanHoesel joined #mojo
06:41 brrt joined #mojo
07:10 AndrewIsh joined #mojo
07:16 jb360 joined #mojo
07:20 trone joined #mojo
07:48 vanHoesel joined #mojo
08:01 absolut_todd joined #mojo
08:14 brrt joined #mojo
08:15 eseyman joined #mojo
08:17 nigel joined #mojo
08:44 sue joined #mojo
08:57 abra joined #mojo
08:58 Vandal joined #mojo
09:21 meshl joined #mojo
09:30 brrt joined #mojo
09:32 sri Grinnz: neat
09:32 sri bpmedley: if you got it into perlbrew, yes, of course
09:34 brrt joined #mojo
09:36 sri bpmedley: also, as usual i would like to see wrk numbers for examples/fast.pl examples/hello.pl
09:55 mattastrophe joined #mojo
10:03 melo joined #mojo
10:28 McA2 joined #mojo
10:39 stephen joined #mojo
11:05 dvinciguerra joined #mojo
11:08 nigel_ joined #mojo
11:16 dod joined #mojo
11:24 kivilahtio_ joined #mojo
11:27 mattastrophe joined #mojo
11:29 sri interesting https://groups.google.com/d/msg/mojolicious/RetqP4QsyHU/Tmo81yzkCgAJ
11:30 sri btw. thinking some more about the cookie jar, i guess $jar->ignore(sub {1}) is not too bad
11:30 sri guess i'll deprecate $jar->collecting
11:51 sri or maybe not :S
11:51 sri guess if i'm so unsure it's better not to
11:53 neilhwatson joined #mojo
12:07 juikuen joined #mojo
12:09 meshl joined #mojo
12:11 Oleg joined #mojo
12:13 Oleg sri: so, non-blocking connect inside IO::Socket::IP for host with several addresses looks broken, at least for kqueue and epoll
12:14 sri Oleg: thanks for looking into it
12:16 romel joined #mojo
12:17 Oleg I think this is even not fixable
12:49 sri Oleg: that would suck, scalability is kinda the point of non-blocking connect :S
12:54 Oleg In my opinion multi-homed non-blocking connect should be removed from IO::Socket::IP and be implemented in the caller code (M::I::C in our case). This is the only way to fix this.
12:57 Oleg Looks like we already may do this with getsockopt( SOL_SOCKET, SO_ERROR ) check when socket will become ready for writing
12:59 sri did you open a ticket yet?
12:59 * sri would like to keep an eye on it
13:01 hernanGOA joined #mojo
13:01 ajr_ joined #mojo
13:01 mattastrophe joined #mojo
13:02 Oleg no, he always ignores my tickets :D
13:03 zivester joined #mojo
13:07 sri please do, i'll poke him if necessary
13:15 sue joined #mojo
13:16 Oleg Ok, https://rt.cpan.org/Ticket/Display.html?id=107103
13:16 sri Oleg: the description is not very good, i think it would help if you explain it in more detail
13:17 sri i can see why one would ignore a ticket like that
13:17 genio heh
13:18 genio He seems pretty responsive in freenode #perl.  can't hurt to engage in conversation about it
13:19 sri in my experience, most authors put about as much effort into their response as you put into your report
13:19 Oleg i don't know what to say more. He will understand the problem
13:20 sri i do not understand for example
13:20 sri you explain the exact problem in as much detail as possible
13:25 Oleg I'll add an example
13:28 sri looks like a terrible situation
13:28 sri are you sure it is the case with kqueue too?
13:29 sri the hiccups i reported might be totally unrelated
13:30 sri btw. do we have an example host on the internet for demonstration purposes?
13:30 Oleg yes, kqueue affected. I played with dup2 and kqueue in January
13:31 Oleg I don't have such host, will try with localhost
13:37 brrt joined #mojo
13:45 abra_ joined #mojo
13:53 Oleg added example
13:58 gryphon joined #mojo
13:58 genio he replied
13:58 sri yea, was about to say :)
13:58 sri looks like he didn't ignore it at all
14:01 sri soooooo
14:01 sri https://github.com/kraih/mojo/blob/master/lib/Mojo/IOLoop/Client.pm#L102-L103
14:01 sri that needs to remove and readd the handle to the reactor
14:02 sri if you had a public host for testing i would give it a try
14:10 Oleg why you don't want to test it on localhost?
14:12 pink_mist he doesn't have epoll?
14:13 Grinnz_ he has kqueue
14:13 Grinnz_ wait, who's "he"
14:14 pink_mist I thought kqueue wasn't shown to reproduce the problem reliably
14:14 pink_mist and he's sri
14:14 PopeFelix joined #mojo
14:16 PopeF joined #mojo
14:18 mattastrophe joined #mojo
14:20 hernanGOA joined #mojo
14:24 abra joined #mojo
14:35 sh4 joined #mojo
14:41 sri correct, i have kqueue, and can't replicate it
14:42 sri i have no clue how my os x loopback interface is configured regarding ipv6
14:45 bpmedley sri: Did you see that the latest perl-build supports cperl.  Also, my wrk numbers are basically the same, I believe, so I'm not sure if I'm doing something wrong.
14:50 hernanGOA joined #mojo
14:53 sri bpmedley: i use perlbrew, not perl-build
14:59 jberger I wonder if that means that perlbrew and perl-build are diverging?
14:59 jberger or does perlbrew depend on perl-build now?
15:00 genio I thought that ^^ but I'd have to re-read to be sure
15:01 batman pretty sure perlbrew only require patch-perl
15:08 sri oh, Oleg is already gone :(
15:08 sri wanted to ask him for a one-liner he tested on his box
15:14 batman does anyone have an opinion on the different coding styles here? https://ssl.thorsen.pm/paste/0f3d4c03165f
15:14 sri allright, can someone confirm that this causes epoll problems?
15:14 sri MOJO_USERAGENT_DEBUG=1 LIBEV_FLAGS=8 perl -Ilib -Mojo -E 'my $daemon = Mojo::Server::Daemon->new->start; my $ua = Mojo::UserAgent->new; $ua->get("localhost:3000" => sub { say pop->res->body }); Mojo::IOLoop->start'
15:15 sri batman: i would avoid eval if i can, even if it is shorter
15:15 batman cool. thanks :
15:15 batman :)
15:15 batman installing the latest mojo now to report back on the one-liner...
15:16 sri LIBEV_FLAGS=4 is epoll
15:16 sri i think
15:16 sri 8 is kqueue, i forgot to change it
15:18 batman sri: https://ssl.thorsen.pm/paste/077d4c0e6cb0 # osx
15:19 batman https://ssl.thorsen.pm/paste/830dead466cf # linux
15:21 sri batman: and you have ipv4 + ipv6 on the loopback device?
15:21 sri s/device/interface/
15:21 Grinnz_ jberger: i don't think they ever depended on each other
15:21 jberger perl-build was extracted from perlbrew
15:22 Grinnz_ right, but it's a separate codebase
15:22 Grinnz_ anyway, there isn't much to "using" perl-build... you just install a perl somewhere, and use it
15:23 batman sri: think so... https://ssl.thorsen.pm/paste/2dc0a1b065e8
15:23 sri batman: odd, that would mean the bug doesn't appear on your box
15:24 sri or my test is wrong, which would suck, since it seems to be triggered on my os x box :(
15:24 Ptolemarch joined #mojo
15:24 Grinnz_ make sure you're actually using EV, too...
15:26 batman sri: this is what i had to change to make mojo-redis2 work with EV: https://github.com/jhthorsen/mojo-redis2/commit/3ed5d3c2305dff81de6b6e6c8965dd5daf53892d
15:26 Grinnz_ sri: with 4, i'm getting no request/response at all..
15:26 batman so i think i can reproduce it...
15:27 sri this is what i think needs to be patched in core https://gist.github.com/anonymous/c4a19aeb1c5cdbedc2c2
15:28 sri you could try that if you have a test case
15:28 disputin joined #mojo
15:28 sri Grinnz_: that's good
15:29 sri Grinnz_: with the patch above it should work again
15:29 sri that would be confirmation
15:30 Grinnz_ sri: yep, works
15:30 sri \o/
15:30 sri thanks
15:32 Grinnz_ on my Fedora box it works without the patch
15:32 Grinnz_ weird...
15:32 sri no dual stack?
15:32 Grinnz_ ?
15:32 sri ipv4+ipv6 on loopback
15:33 Grinnz_ neither box has that anymore AFAIK
15:33 Grinnz_ actually the centos one might
15:33 Grinnz_ hmm they both do
15:34 batman same here on osx (no response) as mentioned here: https://ssl.thorsen.pm/paste/077d4c0e6cb0
15:35 Grinnz_ on centos it was hanging right after the "Connect" line
15:37 good_news_everyon joined #mojo
15:37 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vZ7pn
15:37 good_news_everyon mojo/master 2b8e730 Sebastian Riedel: improve support for epoll/kqueue in Mojo::IOLoop::Client
15:37 good_news_everyon left #mojo
15:37 sri that should make it work everywhere
15:40 good_news_everyon joined #mojo
15:40 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vZ7jR
15:40 good_news_everyon mojo/master 0a84de7 Sebastian Riedel: call it a socket instead
15:40 good_news_everyon left #mojo
15:53 mattastrophe joined #mojo
15:55 mattastrophe1 joined #mojo
16:06 sri wait, i think the case is a little more specific
16:06 sri you need a dual stack loopback interface, and more than one connect attempts
16:07 sri so your app would only listen on ipv4, even though the interface supports ipv6 and ipv4
16:07 sri right?
16:09 sri i'm not even sure if ipv4 or ipv6 is preferred
16:12 irqq joined #mojo
16:24 sri batman, Grinnz, marcus, tempire, jberger, crab: opinions on deprecating Mojo::UserAgent::CookieJar::collecting?
16:24 batman sri: i've never used cookiejar :/
16:25 Grinnz_ i havent really either
16:25 sri it's more about aesthetics
16:25 sri collecting and ignore are a little bit redundant
16:25 jberger I have used it, but not collecting
16:26 sri ignore needs to stay, but collecting could go since ignore(sub {1}) does pretty much the same, a little more inefficient
16:26 jberger I'm ok changing it as long as there is the migration-path and deprecation notice (which I assume there would be)
16:26 sri sure
16:26 jberger and Grinnz_ can add it to his wiki :-P
16:26 sri it's less efficient since collecting(0) prevents cookies from ever being parsed
16:27 sri while ignore() only applies after cookies have been parsed
16:27 batman sri: i would remove collecting($bool)
16:27 jberger could ignore take a bool or a subref?
16:27 Grinnz_ i would err on the side of having the more efficient option available, but i have no context on the use case for these methods
16:27 batman jberger: code
16:27 jberger if its not a subref its a bool
16:27 batman s/code/subref/
16:27 sri i don't really like attributes with different value types
16:27 batman +1
16:27 jberger ok
16:28 sri is there another one already in mojolicious?
16:28 jberger well I don't think it makes a great deal of difference
16:28 jberger I doubt too many people use that functionality anyway
16:28 * sri shrugs
16:30 sri so, we have one +1 from batman and 3 neutral votes
16:31 Flying_Squirrel joined #mojo
16:31 pink_mist +1 from me for what that's worth
16:33 jberger pink_mist: does this affect you (serious question not snark) and if so how do you use it?
16:34 pink_mist no it doesn't
16:34 jberger I'd be really curious to hear from a user
16:34 jberger where did this change come from? or was it just cleanup?
16:34 jberger (sorry I've been extrodinarily distracted from actual mojo development the last few days)
16:35 pink_mist there was a bug with handling cookies from domains without a tld
16:35 pink_mist and when sri looked more into the rfc for how it should be done, he noticed an ignore callback was needed
16:35 pink_mist and with that in place, the collecting setting is superfluous
16:37 sue joined #mojo
16:37 sri https://github.com/kraih/mojo/commit/fd5137bbf542c1bb6bc3530923a693a6eaa58cdc#diff-955b07afef3c0b8632a50118b370262cR516
16:37 sri that example was the important one
16:37 sri jberger was actually there
16:37 sri i remember him participating in the discussions :)
16:38 jberger perhaps I did, but last week seems like ages ago
16:38 sri he was the one who asked about com/net/org domains as defaults
16:38 jberger ah, true
16:38 sri for the previous solution
16:38 PryMar56 joined #mojo
16:38 sri but we needed the callback since the public suffix lists change so quickly
16:38 jberger oh right
16:38 disputin joined #mojo
16:39 jberger and then you can load in the other module if needed
16:39 jberger yeah, ok, I remember now, sorry
16:39 jberger +1 from me
16:40 sri btw. anyone can vote, i value user votes quite a bit for my own vote
16:40 jberger I've have a weekend of ironman, interpersonal conflict, huge amounts of $work, and an old friend as a houseguest since then
16:40 jberger what sri said :-P
16:40 Kogurrr joined #mojo
16:43 * sri had a very bad day in hearthstone... keeps getting beat up by paladins :S
16:48 Ptolemarch joined #mojo
16:53 Ptolemarch joined #mojo
16:58 good_news_everyon joined #mojo
16:58 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vZ5yc
16:58 good_news_everyon mojo/master 9fd79e2 Sebastian Riedel: deprecate Mojo::UserAgent::CookieJar::collecting in favor of Mojo::UserAgent::CookieJar::ignore
16:58 good_news_everyon left #mojo
17:00 damaya joined #mojo
17:01 damaya What's the best way to validate if a site exists (e.g., returns 200)? I'm doing if ( $ua->get($url)->success ) { stuff; }
17:04 genio called that way, yes.  ->get() returns a tx and tx->success makes sure you're getting a 200 response.  https://metacpan.org/pod/Mojo::Transaction#success
17:04 Grinnz that checks more than exists, but yes, that's good enough to check for a 200
17:06 genio head might be a better verb
17:07 damaya I always used head with LWP::Simple to do this. I guess I want to verify more than just there is a web server there. I also want to verify it's not 404.
17:07 mattastrophe joined #mojo
17:12 Grinnz yeah, s/get/head/ and that works fine
17:13 Grinnz you could also use HTTP::Tiny pretty easily for the task: if (HTTP::Tiny->new->head($url)->{success})
17:14 * genio wonders how many useragents exist for Perl
17:14 Grinnz depends how you define user agent :)
17:16 genio LWP::UA, HTTP::Tiny, Mojo::UA, Net::Async::HTP, etc, etc.
17:16 Grinnz there are also about 5 wrappers around HTTP::Tiny to make it slightly less tiny
17:17 Grinnz there's an AnyEvent one (lol), and a POE one sort of
17:17 genio I was purposely forgetting that AE exists
17:17 Grinnz that's my usual policy
17:19 Grinnz https://metacpan.org/pod/POE::Component::Client::HTTP # the POE user agent
17:20 Grinnz generally, all my use cases are served by either HTTP::Tiny or Mojo::UA
17:20 Grinnz HTTP::Tiny's main benefit is being core in 5.14+ :)
17:21 mattastrophe_ joined #mojo
17:23 genio I haven't looked at it really.  I see you can get data chunks as they come in.  that's pretty nice
17:28 Oleg joined #mojo
17:29 Kogurrr joined #mojo
17:30 Oleg sri: can confirm that your commit fixed it, but is it safe to check $! after _wait() call? https://github.com/kraih/mojo/blob/master/lib/Mojo/IOLoop/Client.pm#L104
17:31 mattastrophe joined #mojo
17:39 mattastrophe1 joined #mojo
17:41 berov joined #mojo
17:46 dod joined #mojo
17:55 marty joined #mojo
17:56 mattastrophe joined #mojo
18:00 sri Oleg: i don't know
18:01 marty joined #mojo
18:01 Oleg joined #mojo
18:01 damaya joined #mojo
18:01 PryMar56 joined #mojo
18:01 nigel joined #mojo
18:01 dvinciguerra joined #mojo
18:01 absolut_todd joined #mojo
18:01 mudler joined #mojo
18:01 Dandre joined #mojo
18:01 bobkare joined #mojo
18:01 Zoffix joined #mojo
18:01 dustinm joined #mojo
18:01 mgrimes joined #mojo
18:01 mattp joined #mojo
18:01 da5id joined #mojo
18:01 plicease joined #mojo
18:01 Grinnz joined #mojo
18:01 Repaster joined #mojo
18:01 ssm joined #mojo
18:01 lb joined #mojo
18:01 Lee joined #mojo
18:01 jantore joined #mojo
18:01 hahainternet joined #mojo
18:01 stryx` joined #mojo
18:01 kwa joined #mojo
18:01 geheimnis` joined #mojo
18:01 robinsmidsrod joined #mojo
18:01 Oleg I think, no :)
18:01 mattastrophe1 joined #mojo
18:01 mattastrophe joined #mojo
18:03 Flying_Squirrel joined #mojo
18:05 Ptolemarch joined #mojo
18:06 sri "my ($res, $err) = ($handle->connect, $!);" should work, right?
18:06 * sri is not actually sure about the execution order there
18:07 Oleg also not sure
18:08 sri it does work, but would like to know if that's only accidental :)
18:10 Oleg Explicit is better than implicit :)
18:10 preaction https://metacpan.org/pod/Acme::this
18:10 sri Oleg: you're using the wrong programming language ;p
18:11 Oleg :D
18:14 sri or maybe someone here has a better idea for golfing this down https://github.com/kraih/mojo/blob/master/lib/Mojo/IOLoop/Client.pm#L101-L106
18:15 sri $! needs to be assigned to a $err variable before the ->_wait call
18:16 sri now i'm curious though if it works with older perl versions the same ;p
18:18 good_news_everyon joined #mojo
18:18 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vZdWE
18:18 good_news_everyon mojo/master e36337a Sebastian Riedel: make sure $! gets preserved
18:18 good_news_everyon left #mojo
18:19 sri looking good https://travis-ci.org/kraih/mojo
18:19 sri travis got pretty fast
18:20 sri oh, ipv6 tests are still disabled there
18:20 sri might be worth a try again
18:22 good_news_everyon joined #mojo
18:22 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vZd4P
18:22 good_news_everyon mojo/master f9ce6a7 Sebastian Riedel: run IPv6 tests again
18:22 good_news_everyon left #mojo
18:24 Oleg sri: https://gist.github.com/olegwtf/fc9603339103cea74735
18:24 panshin joined #mojo
18:24 good_news_everyon joined #mojo
18:24 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vZd0e
18:24 good_news_everyon mojo/master e3c6e0c Sebastian Riedel: containers still do not support IPv6
18:24 good_news_everyon left #mojo
18:25 sri Oleg: oh, removeing the handle after the connect call is fine?
18:26 sri that version is still one more line than the current one
18:27 sri might as well just assign $err on its own line ;p
18:28 Oleg is fine if I am not missing something :)
18:30 mattastrophe1 joined #mojo
18:34 sri that simplifies things a lot
18:34 good_news_everyon joined #mojo
18:34 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vZd6R
18:34 good_news_everyon mojo/master 3c42bad Sebastian Riedel: handle sockets a little more efficiently
18:34 good_news_everyon left #mojo
18:34 sri doesn't have to look bad anymore
18:35 sri we only need to readd the handle if $! is set to EINPROGRESS
18:38 PryMar56 joined #mojo
18:39 Oleg good, and it is still works!
18:41 sri \o/
18:42 mattastrophe1 joined #mojo
18:44 neilhwatson joined #mojo
18:49 asm35 joined #mojo
18:56 dod joined #mojo
19:02 trone joined #mojo
19:03 sri z nation is hilarious, one of the best syfy shows in ages
19:10 brrt joined #mojo
19:16 brrt joined #mojo
19:42 nigel joined #mojo
19:44 ajr_ joined #mojo
19:47 meshl joined #mojo
19:58 disputin joined #mojo
19:59 irqq joined #mojo
20:10 Flying_Squirrel joined #mojo
20:24 mattastrophe joined #mojo
20:44 sri neat intro to phoenix https://www.youtube.com/watch?v=STO-uN0xHDQ
20:49 sri also neat, our memory usage appears to have went down since i did my original c10k examples
20:50 sri from 290mb to 270mb
20:51 sri for the server
20:59 asm35 joined #mojo
21:09 jberger :s
21:09 jberger one of my least favorite python problems is in perl6
21:09 jberger perl6 -e '("hi").WHAT.say' # (Str)
21:09 jberger perl6 -e '("hi",).WHAT.say' # (List)
21:10 preaction a list is a real thing now
21:14 jberger yes, but as with python, it is created not by braces but by the comma
21:15 meredith elixir and phoenix are pretty neat. i checked out phoenix a bit but was holding back on really messing with it until 1.0
21:15 jberger syntactic trailing commas are one of my least favorite things in all of programming
21:15 preaction right, but that was always the case in perl 5. , is the list operator. () are for order of operations
21:15 preaction it just happens that , binds extremely loosely
21:16 preaction but now that p6 lists are an actual thing and not just "some stack state", you get that wonderful side-effect
21:16 jberger maybe what I mean is that since a list is ephemeral and used mostly in contruction of other list-context items, it never requires a trailing comma to disambiguate
21:17 preaction right, but it's not ephemeral anymore, it's a thing that has existence. otherwise, you couldn't call a method on it
21:23 jberger and thus now trailing commas might be required
21:24 jberger I'd rather that () not be used as a List constructor then
21:24 preaction it isn't
21:24 preaction , is the list constructor
21:24 jberger hmmmm
21:24 jberger you're right, maybe I'm overthinking
21:24 preaction it just binds so loosely that you always need parens
21:40 irqq joined #mojo
21:49 panshin joined #mojo
21:58 meshl joined #mojo
22:02 marcus sri: I'm with jberger
22:04 sri marcus: on?
22:26 trone joined #mojo
22:49 dvinciguerra joined #mojo
22:52 DaTa Is anybody using Mojolicious::Plugin::YamlConfig?
22:52 LordVorp joined #mojo
22:53 DaTa it bores me, since i've never really used it. I would be happy if somebody else takes care of it
22:54 preaction you can add ADOPTME as a co-maint on PAUSE, then that says someone could take it over if they ask the pause admins
22:55 nemux joined #mojo
22:58 DaTa hmm... good first step i guess, thanks
23:46 bpmedley sri: https://github.com/kraih/minion/compare/master...brianmed:master <-- Thoughts on a Mojo::mysql backend to minion?
23:47 sri bpmedley: sure, not in core though
23:47 bpmedley Why?
23:47 sri because i maintain core, and i don't use mysql ;)
23:48 bpmedley Fair enough.  Would I need to add a Minion::Backend::mysql module to CPAN?
23:48 sri there's already a mongodb backend on cpan i believe
23:49 bpmedley Sweet.  Thanks for minion.  Anyone else use mysql that can test?
23:50 jb360 joined #mojo

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