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

IRC log for #mojo, 2015-01-11

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

All times shown according to UTC.

Time Nick Message
00:07 neyasov joined #mojo
00:09 good_news_everyon joined #mojo
00:09 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/j49CdQ
00:09 good_news_everyon mojo/master a4152c8 Sebastian Riedel: more consistent tests
00:09 good_news_everyon left #mojo
00:28 good_news_everyon joined #mojo
00:28 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/6YVv_Q
00:28 good_news_everyon mojo/master c7addc2 Sebastian Riedel: fixed a few more links
00:28 good_news_everyon left #mojo
00:36 neyasov joined #mojo
01:37 neyasov joined #mojo
01:53 good_news_everyon joined #mojo
01:53 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/pGAd2g
01:53 good_news_everyon mojo/master 6a88449 Sebastian Riedel: better tests for line limit
01:53 good_news_everyon left #mojo
01:58 sugar joined #mojo
02:11 asarch joined #mojo
02:30 tempire <3 postgres jsonb
02:37 klapperl_ joined #mojo
03:07 tempire woo!
03:07 tempire fully converted to postgres
03:08 * tempire dances
03:29 noganex joined #mojo
03:32 neyasov joined #mojo
03:33 * jberger notes that it would be much easier for tempire to market mojo if mojo were called dancer
03:34 jberger tempire is the real perl dancer
03:51 Grinnz haha
03:53 sri \o\
03:53 sri /o/
04:17 jonquest joined #mojo
04:32 lwarstone joined #mojo
04:34 lwarstone How I can launch hypnotoad under perlbrew??
04:34 lwarstone Normal way (perlbrew use perl-5.20.1... hypnotoad...) leaves me perl 5.18 (Saw it in error meesage)
04:53 jberger lwarstone: what version of mojo are you using?
04:56 jberger lwarstone: try using at least version 5.65 tip see if that fixes things for you
04:57 jberger s/tip/to/
05:21 neyasov joined #mojo
05:24 davido__ joined #mojo
05:43 lwarstone joined #mojo
05:44 lwarstone 0/. How I can  hook spawn event in preforking server at startup method?
05:48 good_news_everyon joined #mojo
05:48 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/1_KT4Q
05:48 good_news_everyon mojo/master 8cb57c5 Sebastian Riedel: improved error messages for start-line and header limits
05:48 good_news_everyon left #mojo
05:48 sri no idea why i've not done that earlier
05:49 sri i guess separate env vars and attributes would make sense too... but that would be more of a breaking change
05:50 sri at first i also wanted to reduce the size limit for start-lines from 10kb... but it's actually not too bad... since browsers can send *huge* query strings :)
05:50 sri i've seen mentions of at least 2048 bytes
05:51 sri or rather characters... which may or may not include percent encoding... blowing up the length
06:01 lwarstone Guys, how you are using mojo prefork with DBI???
06:01 lwarstone I'm caching static data at startup (Copy on write saves memory) and than I need to reconnect at fork... I simply can't hook spawn in startup method of my main app. What I need to do??
06:01 lwarstone I can hook CORE::fork, but this is BAD idea!
06:02 Grinnz sri, yeah i'm pretty sure a few things i'm working on could approach that limit
06:02 Grinnz lol
06:04 lwarstone - Doctor, why all people ignoring me?
06:04 lwarstone - Next?!!
06:06 Grinnz lwarstone, generally i don't mess with the forking. shared data comes from a database
06:06 Grinnz DBI will get a new handle on fork if needed, if you're using cached handles you might need to set an attribute
06:07 Grinnz https://metacpan.org/pod/DBI#AutoInactiveDestroy
06:08 Grinnz actually that has nothing to do with cached handles, its for any handle
06:08 lwarstone Hm...
06:09 * sri also wonders if we should do something about less critical bug fixes with security implications... like DoS attack vectors
06:09 sri (like announce them somehow)
06:10 sri i suspect nobody cares too much about those though
06:13 lwarstone It might be an DBD::Pg error. When you connect to db server and than fork - is seems like drive remember old PID and used it in naming for prepared statements. So, next request goes to another process and I've see error like "can't prepare statement, because there is already prepared statement with this name"
06:14 * sri just uses Mojo::Pg, which takes care of forking
06:16 * sri is tempted to rename Mojo::Headers::max_line_size to max_header_size and use a new env var for it (MOJO_MAX_HEADER_SIZE)
06:17 sri there are security implications... but i'm not sure it's severe enough
06:18 dotandimet joined #mojo
06:20 sri TIL nginx has a limit on HTTP headers of 8kb
06:21 Grinnz sounds right
06:21 sri Apache has 8kb too, and IIS 16kb
06:21 Grinnz yeah the only stuff im working on where that matters is through apache atm
06:21 sri Tomcat up to 48kb apparently
06:22 Grinnz lwarstone, are you using server prepare?
06:23 lwarstone It seems... I'm using "default" options from DBIx::Simple with SQL::Abstract. Dosn't dig it inside yet.
06:26 lwarstone BTW... Mojo::Pg is connection pool with some shugar similar to DBIx::Simple but without SQL::Abstract... Why only Pg?? ))
06:26 sri because it uses countless Pg features
06:26 sri there's Mojo::mysql too though
06:27 sri it's not as nice due to lack of many features
06:29 rem_lex joined #mojo
06:30 lwarstone Yep... Like normal ORM )) But I've never see "normal" ORM ever. Best i've see so far is DBIx::Class, but it's not async and too slow.
06:31 sri aha, apache also limits the start-line size to 8kb
06:34 sri hmmmm http://httpd.apache.org/docs/current/mod/core.html#limitrequestfieldsize
06:34 sri "SPNEGO authentication headers can be up to 12392 bytes."
06:34 sri lolwut?
06:34 purl it has been said that lolwut is the pic with that freaky giant pear with a mouth
06:52 Grinnz apache is the mysql of web servers
06:55 sri it convinced me to change the strategy though
06:57 good_news_everyon joined #mojo
06:57 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/mTVYvg
06:57 good_news_everyon mojo/master 8e91547 Sebastian Riedel: added max_lines attribute to Mojo::Headers
06:57 good_news_everyon left #mojo
06:58 sri the nginx behavior is actually quite a bit more complicated and badly documented
06:59 sri multiple levels of buffer settings for performance tunings in addition to security
06:59 sri and default values depending on the operating system :o
07:00 Grinnz heh
07:07 neyasov joined #mojo
07:08 good_news_everyon joined #mojo
07:08 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/KJVD_g
07:08 good_news_everyon mojo/master af6698e Sebastian Riedel: link to both attributes
07:08 good_news_everyon left #mojo
07:14 dod joined #mojo
07:18 dod joined #mojo
07:37 cpan_mojo Mojolicious-Plugin-JSONP 0.04 by Glen Hinkle - http://metacpan.org/release/TEMPIRE/Mojolicious-Plugin-JSONP-0.04
07:54 Grinnz btw sri i've found that EV doesn't always default to select. it defaults to epoll on all of my linux systems
07:55 Grinnz on a related note i've gotten POE::Loop::EV to a working state, just have to see if the author is around
08:10 Vandal joined #mojo
08:23 neyasov joined #mojo
09:24 neyasov joined #mojo
09:34 denis_boyun joined #mojo
09:50 browser joined #mojo
09:51 amon joined #mojo
09:51 browser left #mojo
09:51 reneeb joined #mojo
09:53 basiliscos joined #mojo
10:15 dod joined #mojo
10:20 denis_boyun_ joined #mojo
10:22 denis_boyun joined #mojo
10:29 neyasov joined #mojo
10:42 denis_boyun_ joined #mojo
10:45 denis_boyun joined #mojo
11:10 rem_lex joined #mojo
11:33 basiliscos joined #mojo
11:38 basiliscos joined #mojo
12:59 sh4 joined #mojo
13:27 neyasov joined #mojo
13:45 denis_boyun_ joined #mojo
13:55 denis_boyun joined #mojo
14:19 asarch joined #mojo
14:24 sugar joined #mojo
14:27 jp- joined #mojo
14:29 sugar_ joined #mojo
14:36 basiliscos joined #mojo
14:41 sugar__ joined #mojo
15:14 basiliscos joined #mojo
15:18 basiliscos joined #mojo
15:21 basiliscos joined #mojo
15:28 sri \o\
15:29 sri /o/
15:29 good_news_everyon joined #mojo
15:29 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/jBuivg
15:29 good_news_everyon mojo/master 393264c Sebastian Riedel: test default value too
15:29 good_news_everyon left #mojo
15:45 basiliscos joined #mojo
15:50 meshl joined #mojo
16:19 denis_boyun joined #mojo
16:21 basiliscos joined #mojo
16:45 basiliscos joined #mojo
16:47 basiliscos joined #mojo
17:04 good_news_everyon joined #mojo
17:04 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/BNXQCg
17:04 good_news_everyon mojo/master 51bd70f Sebastian Riedel: more consistent use of imported functions
17:04 good_news_everyon left #mojo
17:07 * sri wonders if there's a more elegant way to handle unexpected 1xx responses than http://mojolicio.us/perldoc/Mojo/Transaction/HTTP#unexpected
17:09 sri right now, if you for example set $tx->res->headers->max_lines(10) in the start event of Mojo::UserAgent it can be unreliable
17:10 sri because if an unexpected 1xx response is received a new Mojo::Message::Response object needs to be built for the real response (or more 1xx responses)
17:11 sri $ua->on(start => sub { my ($ua, $tx) = @_; $tx->res->headers->max_lines(50); $tx->on(unexpected => sub { shift->res->headers->max_lines(50) }) });
17:11 sri that's what you'd really need to do to set the value reliably
17:12 sri hmm
17:14 sri (for anyone who doesn't know, HTTP servers can send as many 1xx responses as they like before the real response)
17:15 alnewkirk joined #mojo
17:21 yourname joined #mojo
17:22 good_news_everyon joined #mojo
17:22 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/A1MFGQ
17:22 good_news_everyon mojo/master 45e94c4 Sebastian Riedel: documentation tweaks
17:22 good_news_everyon left #mojo
17:25 yourname joined #mojo
17:27 good_news_everyon joined #mojo
17:27 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/T2rU9g
17:27 good_news_everyon mojo/master 15eaed0 Sebastian Riedel: reduced number of headers to 100
17:27 good_news_everyon left #mojo
17:27 basiliscos joined #mojo
17:28 sri (100 is the apache default)
17:41 batman oh. this is pretty awful. how can sysread block?
17:42 batman Mojo::IOLoop::ReadWriteFork block on $stdout_read->sysread(my $buffer, CHUNK_SIZE, 0);
17:44 batman $stdout_read is a pipe... maybe it's broken
17:49 batman sri: why does Mojo::IOLoop set $SIG{PIPE} = 'ignore' ?
17:49 batman don't bother explaining if it's complicated. i might not be able to understand :/
17:55 dod joined #mojo
18:09 jberger so I'm about to submit some talks to YAPC::NA
18:10 jberger I'm thinking about w
18:10 jberger 2
18:10 jberger Real-time web-apps
18:10 jberger and "Mojolicious at the command line"
18:10 preaction i like it
18:11 preaction perhaps you could also talk about your experience with modernizing a legacy codebase with mojolicious?
18:11 jberger I use the eval and get commands so much
18:11 jberger I would, that would be fun, but I'm not sure how much would transfer
18:12 preaction maybe that's just a chicagopm talk then
18:12 jberger maybe I should do that first, if it goes well then make that a bigger talk
18:12 jberger I made an HTML::Mason proxy object that actually works pretty well
18:12 jberger so that I don't have to port all of the templates at once
18:13 disco joined #mojo
18:14 preaction yeah, you're right. that might be better as a blog series or more intimate talk where one can ask questions over time (hey, a few months back you gave a talk and i've been trying to modernize our stuff with mojo and ...)
18:14 jberger I've actually been thinking of writing an HTML::Mason renderer plugin seeing as I'm starting to get it now
18:15 jberger that would ease people's usage
18:15 jberger mst++ # putting me on to the Catalyst Mason renderer
18:48 juikuen joined #mojo
19:02 tempire arg
19:02 tempire How do you regex against a number in postgres?
19:03 tempire oh
19:05 tempire to_char all the things
20:01 good_news_everyon joined #mojo
20:01 good_news_everyon [mojo] kraih tagged v5.72 at 6038028: http://git.io/_SPJng
20:01 good_news_everyon left #mojo
20:02 good_news_everyon joined #mojo
20:02 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/Cq7Ihw
20:02 good_news_everyon mojo/master 7942a4a Sebastian Riedel: bump version
20:02 good_news_everyon left #mojo
20:02 cpan_mojo Mojolicious 5.72 by Sebastian Riedel - http://metacpan.org/release/SRI/Mojolicious-5.72
20:03 sri just a few more days and we can finally get rid of all the deprecated AUTOLOAD stuff \o/
20:06 mst \o/
20:15 sri first the JSON features though
20:16 good_news_everyon joined #mojo
20:16 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/FYszlg
20:16 good_news_everyon mojo/master 2b3b0f1 Sebastian Riedel: removed deprecated JSON features
20:16 good_news_everyon left #mojo
20:19 Grinnz http://cpantesters.org :(
20:25 sri dammit, i want that null-conditional operator in perl! http://blogs.msdn.com/b/csharpfaq/archive/2014/11/20/new-features-in-c-6.aspx
20:26 sri my $len = $foo?->bar?->baz // 0;
20:27 DaTa ouh, yeah :)
20:31 cpan_mojo Mojolicious-Plugin-SimpleSlides 0.02 by Joel Berger - http://metacpan.org/release/JBERGER/Mojolicious-Plugin-SimpleSlides-0.02
20:38 denis_boyun joined #mojo
20:59 preaction would that check if $foo is defined before trying ->bar() or just if $foo->can('bar')?
21:00 sri defined would make more sense imo
21:00 sri perl6 has a .? operator that does a ->can() check
21:00 preaction okay, if the latter, i'd think i want ->?name instead, so ? is closer to the name
21:00 preaction and yeah, because of that too
21:00 sri C# and CoffeeScript do a check for null on the left hand side
21:01 preaction might be easier for the perl parser to accept adding ? in front of a bareword after a deref
21:01 sri i think a check for undef would fit better into perl5
21:01 preaction but also, maybe $foo->?{bar}{baz} might be interesting...
21:02 sri $foo->{bar}?->{baz}
21:03 sri (if left hand side is undef, just short circuit and return undef)
21:04 sri my $len = $foo?->{bar}?->{baz} // 0;
21:25 jberger sri: I'm brushing up my mojo introduction
21:26 jberger do you have a current line-count and number of tests handy?
21:27 Grinnz [15:26:11] <sri> my $len = $foo?->bar?->baz // 0;
21:27 Grinnz damn that would be sick
21:29 Grinnz having to check for undef before calling a method on something is always a pain
21:29 jberger omg
21:29 * jberger wants
21:31 bobkare joined #mojo
21:32 sri jberger: 8815 lines and 10670 tests
21:32 jberger sri++ # thanks
21:33 jberger nice! fewer lines and more tests than since the last update
21:33 sri \o/
21:34 jberger was 8928 and 9711
21:34 jberger of course that was May 17, 2013
21:34 sri like 50 lines are also deprecated :)
21:35 sri pretty crazy, considering the number of features that have been added since
21:36 jberger absolutely
21:36 purl Oh my, yes.
21:36 * jberger pats purl
21:36 purl don't mess with me
21:37 jberger purl is getting testy lately!
21:38 jberger also, for all the perception that we break things, my old Mojolicious::Plugin::SimpleSlides (which is more or less deprecated) only needed a few updates to get it going again (and some were do to changes in my Mojolicious::Plugin::PPI)
21:38 jberger anway: http://mojolicious-introduction.herokuapp.com/
21:48 sri oh, this is an excellent http/2 summary https://ma.ttias.be/architecting-websites-http2-era/
21:48 sri neutral and straight to the point
21:49 sri (for anyone who still needs to read up on http/2)
21:50 jberger every time I've read about it, it just makes me sad
21:50 sri especially "the rise of alternative webservers" point is something i've been noticing a lot recently
21:50 preaction could they not have done some of this without going to a binary-only protocol? :(
21:51 sri most of us won't be having app server that speak http/2 directly, but reverse-proxy setups, lots of room for new webservers to emerge
21:52 sri i think his "varnish on port 80, nginx on port 443, and app server on port 8080" setup might become pretty common
21:53 preaction http/2 to the world, http/1 inside... interesting
21:53 sri with 443 talking to 80 and 80 talking to 8080
21:54 * sri sees http/2 more and more just like SPDY, an optimization for browser/webserver communication
21:54 sri devs just don't touch it
21:55 sri in general, http/2 is slower than http/1
21:55 sri it only gets faster when you have to pipe like 50 resources quickly through it
21:57 sri the H2O author is one of the japanese perl guys btw. :)
21:58 sri https://github.com/h2o/h2o
21:59 sri that server could be a rising star in the http/2 world, i keep seeing references to it everywhere these days
22:00 sri gotta love optimizations like this in an http parser :D https://github.com/h2o/picohttpparser/pull/10
22:00 sri (take a look at the code)
22:03 jberger I have no idea what that is
22:32 meshl joined #mojo
23:17 good_news_everyon joined #mojo
23:17 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/p1wwNg
23:17 good_news_everyon mojo/master 759215c Sebastian Riedel: removed deprecated Mojo::DOM features
23:17 good_news_everyon left #mojo
23:18 sri everyone who was annoyed with the AUTOLOADs can now just checkout master :)
23:19 sri jberger: 8769 lines ;p
23:23 sri i suspect if we add http/2 support that would be maybe 500 lines of new code
23:25 sri or 100 with maximum CPAN module reuse

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