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

IRC log for #mojo, 2015-01-02

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

All times shown according to UTC.

Time Nick Message
00:17 akhasanov joined #mojo
00:22 asarch joined #mojo
00:23 asarch left #mojo
00:24 asarch joined #mojo
00:32 jberger sri: what does this mean?
00:33 jberger "It also introduces    unsolicited push of representations from servers to clients."
00:34 jberger does that indicate that the server can initiate a websocket or similar connection, rather than it needing to be initiated on the client?
00:34 jberger I'm not sure I like the sound of that
00:34 preaction i think it's more that the server can send "replies" for request that weren't sent
00:35 preaction so, what we'd normally use websockets for, the server could ask the client to hold open the http connection and receive more replies
00:36 jberger that sounds more like a codification of comet (though server initiated)
00:37 preaction server push used to be a thing, a long long time ago
00:38 preaction it was never standardized though, not back then. not sure why. i never used it, never saw it used either
00:39 preaction so, partially, yes. but comet is a terrible abuse of browsers and servers
00:54 neyasov_ joined #mojo
01:44 disputin joined #mojo
01:48 sri jberger: no, the server can basically write to the browser cache directly
01:49 sri anticipating future requests
01:51 sri at least that's the theory
01:53 jberger Hmm interesting
01:54 preaction that's a rather content-provider-centric view of the web. _they_ choose what i see next? what couldn't they put on my computer with that?
01:54 jberger preaction: especially if you are bandwidth limited
01:54 preaction ... uh. yeah. what couldn't they put on my computer with that?
01:54 preaction there are data that are illegal to possess.
01:55 sri actually, we already have prefetching https://developer.mozilla.org/en-US/docs/Web/HTTP/Link_prefetching_FAQ
01:55 preaction sure, but that's browser-side, not server-side
01:56 neyasov_ joined #mojo
01:56 jberger Funny I can actually see those when I'm debugging stuff on the new project
01:56 sri anyway, at the end of the day it doesn't matter what you think, this spec is gonna happen no matter what
01:56 jberger Seems that way
01:57 preaction it feels like there's going to be a new browser wars out of all this...
01:57 sri nope, all browser vendors are in on it
01:57 preaction all the present ones, yes
01:57 sri well, except for apple, but they are warming up to the idea
01:59 preaction i'm kind of surprised MS is, considering their userbase (businesses). but i suppose that prefetching mechanism will be able to be turned off (it'd have to be, the capacity for malicious use seems massive)
01:59 sri i really wonder what low concurrency framework will do
01:59 sri *+s
02:01 sri MS is also a web giant
02:01 purl okay, sri.
02:01 sri it's all about cost saving for the web giants
02:01 sri which i assume is why apple doesn't care very much
02:02 jberger MS?
02:02 purl MS is a degenerative disease. or Method::Signatures or a web giant
02:02 preaction i suppose it's more that MS, if it isn't now a web giant, wants to be one. but MS is kind of schitzophrenic
02:02 preaction MS is also MicroSoft
02:02 jberger guess that's not wrong
02:02 purl okay, preaction.
02:10 espent joined #mojo
02:47 klapperl joined #mojo
03:08 asarch What does "Can't create listen socket: Address family for hostname not supported at /usr/local/share/perl5/Mojo/IOLoop.pm line 120." mean?
03:11 Nemix__ did that just start happening for you when it was working before?
03:12 jberger asarch: http://stackoverflow.com/questions/5985470/ipv6-address-to-domain-name
03:13 asarch I wrote a small Mojo app and I start that app at boot process
03:14 asarch Oh, there is no support for IPv6 in México
03:14 asarch Only IPv4
03:15 asarch If I start the app *after* I log in, everything is fine
03:16 jberger sounds like your resolver configuration isn't loaded until after you login perhaps?
03:17 jberger out of my realm sorry
03:17 Nemix__ how do you start the things befre you login?
03:18 Nemix__ through some init script?
03:18 asarch In both cases, I use:
03:18 asarch PERL5LIB=.:./schema DBIC_TRACE=1 morbo script/server
03:19 asarch In Slackware you can add your own init script at /etc/rc.d/rc.<my_script_name>
03:19 asarch And then enable it at: /etc/rc.d/rc.local
03:19 Nemix__ so it is the same script at boot time as is done after login?
03:19 asarch Yes, it is
03:20 Nemix__ like jberger said...that or some depenency is not being met
03:20 Nemix__ s/depenency/dependency
03:22 asarch Oh, then I have to find a way to delay the app until everything is fully loaded
03:22 asarch Thank you guys
03:22 asarch Thank you very much :-)
03:41 noganex_ joined #mojo
03:45 neyasov_ joined #mojo
04:23 disputin joined #mojo
04:42 bjoernfan joined #mojo
04:59 alnewkirk joined #mojo
05:08 xevz joined #mojo
05:21 cfedde ttps://begriffs.com/posts/2014-12-30-intro-to-postgrest.html
05:34 neyasov_ joined #mojo
06:00 rem_lex joined #mojo
07:40 Grinnz so, i was getting kind of pissed off that i couldn't figure out wtf EV's signal watchers were doing
07:41 Grinnz and i kind of wrote a Mojo::Reactor::POE because it doesn't need to worry about signals
07:41 Grinnz and i think it works
07:42 Grinnz https://github.com/Grinnz/Mojo-Reactor-POE
07:43 Vandal joined #mojo
07:44 Eke- joined #mojo
08:09 trone joined #mojo
08:23 kwa joined #mojo
08:25 eseyman joined #mojo
08:26 dod joined #mojo
08:38 Grinnz if someone feels like giving it a try with a real application that would be awesome :) for now, bedtime
08:56 nemux joined #mojo
09:02 nemux joined #mojo
09:10 nemux joined #mojo
09:32 dotandimet joined #mojo
09:37 amon joined #mojo
10:06 Kharec_ joined #mojo
10:06 Kharec_ joined #mojo
10:28 mtths joined #mojo
10:56 dod joined #mojo
10:59 mtths joined #mojo
11:03 basiliscos joined #mojo
11:33 denis_boyun joined #mojo
11:38 panzana` joined #mojo
11:43 sh4 joined #mojo
12:07 punter joined #mojo
12:53 * sri thinks http2 might never become a backend protocol
12:53 dotandimet joined #mojo
12:54 sri guess what we'll see this year is people activating it in their reverse proxies, and sticking to http1.1 for talking to app servers
13:14 neilhwatson joined #mojo
13:23 juikuen joined #mojo
13:35 jberger sri: I can imagine that happening
13:35 jberger Grinnz: cool, I'll try ForkCall against it soon
13:41 sri what we will see is a new system for server push i bet
13:42 sri perhaps a header where you hint at resources that are worth prefetching, and the reverse proxy learns those automatically over time
13:42 sri and then starts pushing those to the browser cache as soon as the next request arrives
13:44 sri i think the jetty folks have been experimenting with a system based on the Referer header
13:44 sri jetty then learned which resources are linked to each other
13:45 rem_lex joined #mojo
13:54 denis_boyun joined #mojo
14:03 sri hmmmm
14:03 sri Mojo::mysql::Migrations
14:03 sri that seems dangerous
14:05 sri this doesn't look right https://metacpan.org/source/JHTHORSEN/Mojo-mysql-0.04/lib/Mojo/mysql/Migrations.pm#L48
14:05 sri compare with the original https://metacpan.org/source/SRI/Mojo-Pg-1.06/lib/Mojo/Pg/Migrations.pm#L50
14:07 batman oh. that's no good :(
14:07 batman i guess i should done a more thorough read through when i accepted the pull request
14:08 sri to be fair, locking the table doesn't make it much safer
14:08 batman sri: "that seems dangerous" ... the whole idea, or line 48/50?
14:08 sri one typo and you'll fight with half applied migrations
14:09 batman https://metacpan.org/pod/Mojo::mysql#migrations
14:09 batman "MySQL does not support DDL transactions. Therefore, migrations should be used with extreme caution. Backup your database. You've been warned."
14:09 sri ¯\_(ツ)_/¯
14:10 batman sorry... i don't get that smiley :(
14:32 jberger batman: shrugging
14:32 batman ok. thanks
14:45 sri these days also called the obama
14:46 sri "We tortured some folks. ¯\_(ツ)_/¯"
14:46 sri purl: no, obama is <reply> We tortured some folks. ¯\_(ツ)_/¯
14:46 purl okay, sri.
14:51 muraiki from what I had read re: http2, I thought the "server pushes other resources it thinks you'll also need" idea had been in it for a while
14:52 sri the idea is inherited from spdy
14:52 muraiki ah yeah
14:52 muraiki I have never used that
14:52 sri http2 is now basically the shitty version of spdy
14:53 sri spdy simply used gzip for headers compression, and http2 this mostrosity http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-10
14:53 muraiki I've read in some places that http2 is bi-directional, but I'm not certain if they mean in this context or in a "way to replace websockets" context
14:54 sri for almost no gain
14:54 muraiki is this the thing where it tries to send diffs of headers or something similar?
14:54 sri the protocol itself is bi-directional, and you map http/websocket semantics on top of it
14:55 muraiki I see
14:55 sri it's a really shitty protocol
14:56 sri we are still looking for volunteers to implement it though ;p
14:57 muraiki hahaha
14:57 muraiki I'm still at the point where I'm just starting to use websockets
14:57 muraiki so I will stay away from something crazy like http2 for now
15:03 asarch joined #mojo
15:07 denis_boyun_ joined #mojo
15:25 irq joined #mojo
15:38 Ptolemarch joined #mojo
15:55 dod joined #mojo
16:03 cfedde joined #mojo
16:19 vytas joined #mojo
17:01 neilhwatson joined #mojo
17:06 McA joined #mojo
17:06 ua_ joined #mojo
17:56 denis_boyun joined #mojo
17:57 Grinnz_ jberger: made some updates, i think i am about satisfied for a 0.001 release
17:57 Grinnz_ it will spit out the dreaded POE warning if you set a timer or something then don't start the loop, but i don't want to do anything too hacky
17:59 Grinnz_ on second thought, i should add that to CAVEATS as well
18:00 Nemix__ is there a mojo wait to watch for new files in a directory and fire off an event when one occurs?
18:02 preaction Nemix__: I wrote something using Mac::FSEvents to do that, but there's no Mojo-specific one (yet)
18:02 Nemix__ great..thanks...will look at something linuxy
18:03 Nemix__ I am used to POE which has something for everything :)
18:04 Grinnz_ how do i escape > in a C<> again
18:04 Grinnz_ \ clearly wasn't it
18:05 Grinnz_ Nemix__: that's why i'm working on this :)
18:06 Nemix__ well I better start working with it then!
18:12 Nemix__ so...although I have used POE for an app or two I am not quite getting how I can use Mojo-Reactor-POE to take advantage of something like POE::Co::DirWatch.  I don't need any of the other POE bits?
18:12 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Event-loops
18:12 Grinnz_ Mojo::Reactor::POE just makes Mojo use POE as the event reactor
18:13 Grinnz_ so that you can run your own things in POE at the same time
18:13 Ptolemarch joined #mojo
18:13 Grinnz_ well, "allows", it only "makes" if you set MOJO_REACTOR ;)
18:13 sri what's the performance like with POE?
18:14 Grinnz_ i dunno, how can i benchmark it :P
18:15 sri perl examples/hello.pl daemon -m production; wrk -c 100 -d 10 http://127.0.0.1:3000
18:15 Grinnz_ i believe it uses Select by default, but it could be set to use IO::Poll
18:18 Grinnz_ hmm i don't have a "wrk" binary
18:29 Grinnz_ https://github.com/wg/wrk ?
18:29 Nemix__ Grinnz:  Just copy the module to the appropriate place for my perl?
18:30 Grinnz_ Nemix__: when i release it you can install it from CPAN. but yes it's a simple pureperl module
18:30 Nemix__ ok
18:30 Grinnz_ Nemix__: just make sure your POE and Mojo are up to date.
18:34 Nemix__ ok
18:34 Grinnz_ sri: http://paste.fedoraproject.org/165046/2236571/
18:36 sri Grinnz_: you need two benchmarks to compare them ;p
18:36 Grinnz_ http://paste.fedoraproject.org/165046/02236571/ that is with EV
18:37 * mst sort of surprised you didn't write POE::Loop::Mojo instead
18:37 Grinnz_ mst: that was actually my next though
18:37 Grinnz_ thought*
18:37 Grinnz_ and then, what happens when you use both!? (probably nothing)
18:38 Grinnz_ http://paste.fedoraproject.org/165050/20223819/ another with EV
18:38 Grinnz_ idk
18:38 sri i hear that's how you summon a greater evil
18:38 mst Grinnz_: then I send you to #io-async to discuss event loop jenga with leonerd
18:39 Grinnz_ haha
18:39 Ptolemarch joined #mojo
18:41 Grinnz_ whoops, my first EV paste was actuall the POE one again
18:41 sri that makes sense, you'd expect POE to be rather slow
18:41 mst hence thinking POE-atop-Mojo
18:42 mst it is possible to do POE fast, but it's hardly easy
18:42 Grinnz_ setting POE to use IO::Loop doesn't make much difference
18:42 mst the key problem is that because it started off using select
18:42 Grinnz_ indeed
18:42 mst it's optimised for handling 'all read', 'all write' etc. at once
18:42 mst so then when you stick it atop something that doesn't follow that model
18:43 mst it self-pessimises
18:45 Grinnz_ even using Event doesn't make much difference
18:47 sri that benchmark shouldn't be context switching much, i'd expect most transactions to be handled in one read and one write operation
18:49 Grinnz_ it's possible there's inefficiency introduced by what i'm doing too
18:51 Grinnz_ also, is the new() override that returns Mojo::Reactor::Poll in Mojo::Reactor::EV so that you could run a loop inside a loop?
18:51 Grinnz_ didn't see anything documented :P
18:51 Grinnz_ but i basically copied that
18:51 stephan48 is there a easy way to do deduplication with minion? f.e. if there is a job identified by a token already in the queue don't enqueue new jobs with the same token before that job is finished
18:53 Grinnz_ stephan48: https://github.com/kraih/minion/issues/7 has some discussion about that
18:54 mst Grinnz_: you can only have one EV reactor at once
18:54 mst Grinnz_: but, then, if you're inside a request, you don't want the top level reactor to try and accept an extra connection
18:54 mst Grinnz_: so IIRC Mojo gives you a ::Poll reactor inside, so you can do async-with-the-request without fucking yourself
18:54 mst sri: did I remember that right?
18:55 Grinnz_ i was thinking different Mojo::Reactor::POE could use a different POE::Session, but if they're supposed to run two separate loops then i need to do it the same way as EV
18:55 Grinnz_ well "separate"
18:55 dod joined #mojo
18:56 Grinnz_ which is what it's doing now
19:09 ignacio_ joined #mojo
19:09 basiliscos joined #mojo
19:18 * Grinnz_ can't wait to see the FAIL reports from cpantesters
19:21 mst smoking is good for you
19:23 Grinnz_ i enjoyed reading AnyEvent::Impl::POE's rant about POE, even MLEHMANN thought RUNNING_IN_HELL (POE's indication of running on windows) was funny
19:25 Eke- joined #mojo
19:25 juikuen joined #mojo
19:31 Nemix__ so what is the mojo way to have a helper send an event such that a route can receive it?
19:31 mst Grinnz_: yeah, though if you click through to the thread you'll find that most of the rant is a lie and he preferred to scream at Rocco and I rather than actually fix anything
19:32 mst Nemix__: routes are for http requests. having one receive an event makes no sense.
19:33 Nemix__ I have have a helper generating interesting bits of information that clients connected to a websocket based route are interested in
19:34 Grinnz_ mst: i especially enjoyed that he linked the explicit proof of him being an ass, and then said there wasn't any evidence ...?
19:34 mst yeah, it's AWESOME
19:35 mst saved me having to hang onto a link to that thread when explain what a colossal cock he is
19:35 mst I was most greatful
19:36 mst grateful
19:36 mst why can I never spell that on the first try
19:36 Grinnz_ Nemix__: that sounds like a use for a database of some sort
19:36 Nemix__ then poll the DB?
19:37 Grinnz_ Nemix__: depending where this helper is running...
19:37 Grinnz_ just keep in mind all websocket and HTTP connections won't be happening in the same processes when using a preforked server
19:37 denis_boyun joined #mojo
19:38 Nemix__ good point...I am working on an app that will be used by at most 2 clients so have not thought beyond morbo
19:39 damaya joined #mojo
19:39 Nemix__ I was hoping to avoid  polling something but that is not the worst thing in the world...the helper is creating files as well hence why I was looking at a filewatcher approach
19:40 Grinnz_ a file can be a database.
19:40 Grinnz_ but really, thats what databases are for
19:41 Nemix__ yep
19:41 Nemix__ the helper will be updating a DB (not yet implemented) so I will just poll that
19:42 Grinnz_ i hear Mojo::Pg is pretty nice
19:44 mst just bear in mind it's a DBI/DBD::Pg interface, not something that provides any SQL generation - but you can get that part from CPAN separately just fine if that's what you want
19:44 Nemix__ for my situation I am using sqlite...but I have used Pg for other stuff
19:46 muraiki I've used sqlite for small things before but I've heard that it can handle a decent amount of data. features aside, is there a point in scale when I should think, "ok, sqlite is too small for this"?
19:46 muraiki since it was brought up -- sorry for asking about sqlite in #mojo. just curious
19:47 Grinnz_ probably once you plan to have a lot of simultaneous connections
19:47 muraiki thanks, that's good to know
19:48 Grinnz_ if your queries start getting pretty complicatd, too
20:03 Grinnz_ batman: it doesn't look like the pull request on Mojo::APNS to change the IO::Socket::SSL requirement worked correctly
20:05 mst muraiki: sqlite can't really do write concurrency, and of course it's a file so it doesn't handle multiple webheads with a single db
20:05 mst muraiki: plus postgres has a billion batshit insane and brilliant features that let you do ridiculously complicated things efficiently
20:05 muraiki thanks. I'm still a noob, heh
20:05 mst muraiki: when one of those things matters, switch
20:06 muraiki I want to try out postgres' new json stuff
20:07 Nemix__ My application is two guys on a golf cart with a case of beers watching an auto race on 640 acres.  The database is to record what comes up on our radio scanners...sqlite works pretty well there :)
20:07 * mst grins
20:08 mst I care very little about postgres' json stuff so far
20:08 mst largely because when I use json, I use it for "this is an opaque blob of random stuff don't try and query it if you were supposed to query it I'd've made it a column go away"
20:09 mst this is, however, only an opinion :)
20:09 Grinnz_ that's how i use it. but then again, i am stuck with mySQL
20:10 Grinnz_ being able to throw indexes on JSON keys significantly changes the usability
20:10 mst yeah, but I actually -don't- want people doing that for my uses
20:10 mst the whole point was "here's where you stick aribtrary data you can't query so nobody tries to EAV my database"
20:11 mst guess I'll have to switch to YAML for that or something ;)
20:11 Grinnz_ lol
20:14 ua_ joined #mojo
20:29 s1037989 joined #mojo
20:30 Ptolemarch joined #mojo
21:00 jberger reading the ae poe stuff
21:01 jberger "AnyEvent consequently patches the POE kernel so it thinks it already ran."
21:01 jberger wtf
21:01 jberger he gets to poke at poe internals, but when other modules do that to him they get exit 1?
21:01 preaction yes
21:06 Grinnz_ yep
21:59 ua_ joined #mojo
22:10 ua_ joined #mojo
22:52 jay_m joined #mojo
23:03 jay_m i have some trivial cookie handling tests in my test kit (Test::Mojo) that worked in 5.68 but not in 5.71, any changes to cookie_jar lately?
23:30 Grinnz_ guess they weren't that important
23:48 Nemix__ it starts out that way.  then they come for our core functionality.
23:49 asarch joined #mojo

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