Camelia, the Perl 6 bug

IRC log for #mojo, 2013-07-23

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

All times shown according to UTC.

Time Nick Message
00:30 egopro joined #mojo
00:43 btyler joined #mojo
00:43 shmuel joined #mojo
01:33 d4rkie joined #mojo
01:56 Meiermann joined #mojo
01:58 btyler joined #mojo
03:03 hesperaux_ joined #mojo
03:19 basic6 joined #mojo
03:34 preflex_ joined #mojo
04:16 punter joined #mojo
05:05 egopro joined #mojo
05:11 egopro joined #mojo
05:23 marcusie joined #mojo
05:41 dod joined #mojo
05:42 marcusie joined #mojo
05:43 Britzel_ joined #mojo
05:52 dod joined #mojo
05:55 forke joined #mojo
06:10 forke Morning guys, I have a little question, did everyone know if mojo has a RSS plugin? or how I can implement it?
06:17 Vandal joined #mojo
06:28 Mike-PerlRecruiter_ joined #mojo
06:32 dpetrov_ joined #mojo
06:49 dod joined #mojo
06:56 batman joined #mojo
06:56 batman_ joined #mojo
06:59 marcus_ joined #mojo
06:59 batman joined #mojo
07:00 batman_ joined #mojo
07:05 batman joined #mojo
07:06 punter How do we re-connect to a closed websocket? Is "new Websocket" the only way? And will I need to re-attach all the event handlers (onmessage, onclose) when new runs again?
07:06 punter Is there a way to reconnect without having to reattach the event handlers?
07:25 trone joined #mojo
07:34 nicolaas joined #mojo
07:38 fhelmber_ joined #mojo
07:41 yakudza joined #mojo
07:56 wk joined #mojo
08:03 entro joined #mojo
08:18 ver joined #mojo
08:18 dod joined #mojo
08:29 rem_lex| joined #mojo
08:34 punter left #mojo
08:46 cosmincx joined #mojo
08:46 cosmincx left #mojo
08:47 jzawodn joined #mojo
09:11 marcus_ joined #mojo
09:11 batman joined #mojo
09:34 egopro joined #mojo
09:36 egopro joined #mojo
09:40 StinkfooT joined #mojo
09:56 dod joined #mojo
09:59 punter joined #mojo
10:39 marcus_ joined #mojo
10:58 batman punter: do you use jquery?
10:58 punter batman: slightly, yes
10:58 punter batman: but less so, ever since I started using Angular.js
10:59 punter why?
11:00 batman https://gist.github.com/jhthorsen/5813032 <-- reconnecting ws with events
11:01 punter interesting, thanks
11:01 batman it allows you to do ws.send(data); without being connected
11:01 batman ...will then send the data, once you get connected
11:02 batman *just works* :)
11:03 dr joined #mojo
11:03 punter amazing!!
11:04 punter I'll make an Angular service out of it
11:04 batman whatever floats your boat.
11:05 batman oops! a bit too much code got pasted to the gist (!)
11:06 punter are you thorsten?
11:06 batman punter: https://gist.github.com/jhthorsen/5813032 <-- updated
11:06 batman no.
11:07 batman i think the url pretty much tells you who i am...
11:07 punter You would be thorsen then
11:07 batman if you look at the bottom, you can read about options and other events
11:09 punter Is $.Deferred a standard jQuery function?
11:09 punter does it need a special library?
11:12 batman no. it's part of jQuery
11:12 batman at least if you don't have jQuery stone age editon...
11:12 batman http://api.jquery.com/category/deferred-object/
11:13 punter I use jQuery 2, so that IE users will have problems
11:13 punter so that they upgrade to FF
11:14 batman haha
11:14 batman then you should have Deferred :)
11:16 batman joined #mojo
11:36 maxhq joined #mojo
11:44 rem_lex|pivo joined #mojo
12:19 russum joined #mojo
12:21 russum left #mojo
12:41 iankent joined #mojo
12:58 iankent qq about non-blockingness... probably a stupid question tbf :p
12:58 * batman feels old... qq? tbf?
12:59 iankent qq - quick question, tbf - to be fair
12:59 iankent sorry!
12:59 batman (but there's no question)
12:59 iankent mojo is non-blocking, and (hopefully) our code is non-blocking too... what happens if for any reason one request blocks? does the event loop block until the blocked request completes, or does mojo have any way of breaking out of that?
12:59 iankent (was still writing it :p)
12:59 hrupp_ joined #mojo
12:59 iankent the concern we have is, as much as we can try and make sure our code doesn't block... if for any reason it does, what happens to all the other requests on the loop? or are we just stuffed
13:00 batman iankent: du have a timeout which will kill the child if running inside hypnotoad
13:01 iankent wouldnt that kill that child plus all the connections its holding? so if we have 500 connections in one loop on one process, wouldn't that kill all of them?
13:01 batman yes.
13:01 iankent is that generally the accepted risk using event loops?
13:01 batman i would say so.
13:01 batman so you should check your logs and if you see a child is getting killed, then you need to figure out why that happened
13:02 batman as you said yourself: it should not happen...
13:02 sri you can always invest tons of $$$ in memory and reduce concurrent connections per worker to 1 ;p
13:02 iankent sri: thats what we have now, preforked apache :/
13:02 batman i'm guessing the app could block for a longer period if some DBI query takes forever...
13:03 sri it's all about tradeoffs
13:03 iankent we're just worried we might miss something, so even though we're being careful to make our code non-blocking, if we miss something we might mess up thousands of concurrent connections on that loop
13:03 batman iankent: sounds like the system is too complicated :(
13:03 batman s/system/code/
13:04 batman i'm pretty confident that i know when my non-blocking code will block. and when it does, there's something else that needs fixing.
13:04 batman not my "non-blocking" code
13:05 batman map out all the resources you're talking to and figure what might block. unless you built a super complicated system, it shouldn't be too hard
13:13 iankent sadly its not that we've built a super complicated system, but that we've inherited one
13:13 iankent the new mojolicious site itself is written non-blocking, but we have blocking dependencies we need to work around (tuxedo for example)
13:13 iankent we know about most of them, we're just a bit worried about the ones we don't know about (unexpected DNS lookups etc)
13:22 batman tuxedo? doesn't sound non-blocking to me...
13:23 batman that's like saying print Mojo::UserAgent->new->get('http://icanhazip.com')->res->body is non-blocking because it's *normally* fast
13:26 moltar joined #mojo
13:26 sri fun fact, Mojo::UserAgent uses blocking DNS lookups
13:26 bluescreen joined #mojo
13:29 sri nothing is 100% non-blocking, and it doesn't have to be, you just have to make sure that nothing blocks for too long
13:30 batman that is true. i just barely looked at tuxedo and it seems a bit more *blocking* than dns
13:33 punter I run two Mojo servers, one allowing many concurrent connections to serve websockets where all the requests are non-blocking, and one for www-style requests that block
13:33 punter the one that blocks doesn't allow many concurrent connections
13:35 punter Not that this has any relevance to you whatsoever
13:37 batman punter: i think it was interesting input actually
13:37 batman sri: i'm thinking that if the resource that you try to make non-blocking is faster than the non-blocking code in 99% of the cases, then it's no reason to make it non-blocking...
13:38 batman like dns is typically fast as &"(#
13:42 jpl joined #mojo
13:43 jpl (how) can I fire off an async HTTP request to self from within Mojolicious::Lite request handler and return to the client immediately without waiting for the request's response?
13:44 jpl I imagine this should be possible, but somehow I get either a blocking HTTP request or the request is not issued at all :(
13:46 jpl or is there a better way to launch a "background task" (my intention was to let one of the workers handle this task)
13:46 sri job queue
13:46 fildon joined #mojo
13:47 batman jpl: you can't rely know that the request has been successful without an external job queue
13:48 batman but you can "do your best" by storing the $ua in som global variable
13:49 batman marcus_: ok that i submit our client here: http://redis.io/clients ?
13:51 jpl batman: the background request just to warm up a cache, so it's non-critical. I just don't seem to be able to make ua issue the request and return without blocking for response.
13:52 jpl batman: does it matter whether $ua is in a global or local (lexical) variable?
13:52 batman no
13:52 batman jpl: how long does you app live?
13:52 batman do you run some sort of mojo daemon?
13:54 jpl batman: hmm running morbo that may be the problem
13:54 jpl batman: I'm not running anything special, just Mojolicious::Lite and morbo and trying $ua->get($url, sub => {});
13:55 jpl batman: (from within a handler, that is)
13:56 sri ignoring the typo, what makes you believe it doesn't work?
13:56 batman jpl: https://gist.github.com/jhthorsen/6062529
13:57 gryphon joined #mojo
13:58 sri batman: BAAAAAD!
13:58 batman then fork me
13:58 batman ;)
13:58 jpl batman, thanks, perfect! for some reason it didn't work with my $ua = Mojo::UserAgent->new() instead of app->ua
13:58 sri relative url means you're starting a server inside the server
13:59 sri jpl: because it goes out of scope!
13:59 batman sri: i thought Mojolicious::Lite fixed that for me...
13:59 batman jpl: my $foo is still lexical, even though it's in the outer scope
14:00 jpl ahh I see stupid me
14:00 batman jpl: like this: https://gist.github.com/jhthorsen/6062529
14:00 jpl batman, true, moving the "my" to top-level scope works as well
14:01 sri http://blog.littlebigfund.org/wp-content​/uploads/2013/04/facepalm-wallpaper.jpg
14:01 bluescreen joined #mojo
14:02 batman sri: better now: https://gist.github.com/jhthorsen/6062529 ?
14:02 sri better
14:03 iankent delayed response, but your right, tuxedo is extremely blocking, but we can fix that using IOLoop client anyway. its all the other stuff is an issue
14:03 iankent sri: didn't realise DNS was blocking in UA, actually (paradoxically) makes me feel a bit better :)
14:03 iankent and thanks all, got a bit more confidence in the direction we're going!
14:04 sri i'd do DNS non-blocking if i could though
14:04 iankent we'd looked at anyevent::dns (for the tuxedo stuff), but haven't given it too much thought yet
14:04 sri AnyEvent::DNS sucks
14:05 sri bypasses the system resolver which makes tons of stuff not work
14:06 sri sadly most people don't actually know that they don't really want *pure* DNS
14:07 bjoernfan What do they actually/probably want then? /curious
14:07 sri the system resolver with all its extensions
14:10 sri imo the only way to properly implement a non-blocking resolver is a with a pool of threads and getaddrinfo()
14:10 bjoernfan I think we had (or still have) som issues at work with SVN (the server) totally ignoring the OS resolver, meaning it doesn't cache results at all.
14:10 sh4 joined #mojo
14:11 sri without the system resolver stuff like mdns just doesn't work
14:12 bjoernfan Yeah... I wonder why it wouldn't use the system resolver.
14:15 sri batman: btw. are you having any problems with wirc getting banned from servers yet?
14:15 batman sri: no. why?
14:16 * sri thought too many connections from the same ip get you in trouble
14:16 iankent sri: didn't realise that about AE::DNS, will probably avoid it then!
14:16 sri iankent: it's not like there are many alternatives though
14:17 batman sri: could be... i'm currently just on irc.perl.org. also, we don't really have that many users
14:17 * sri considers doing an irc product too :o
14:18 sri no irc client though (don't worry!)
14:21 batman hehe
14:21 batman what kind of product?
14:23 sri will show when i have a prototype :)
14:29 * batman doesn't get ideas + secrecy
14:32 robinsmidsrod joined #mojo
14:32 batman i also never worry if someone will steal my products...
14:35 sri the idea is not really secret, but sounds dull without context ;p
14:35 batman sounds fun!
14:36 * sri wants to make a better irclog
14:37 denis_boyun joined #mojo
14:37 batman that makes sense
14:38 batman i want to merge your product with wirc :)
14:40 sri you've not seen it yet :)
14:42 sri the fact that all products around irc seem to fail is a little worrying though :S
14:42 batman still. the backend would be what i want.
14:43 batman yeah. it sucks big time...
14:50 * sri just noticed http://grove.io still exists
15:00 * sri is melting
15:08 gryphon_ joined #mojo
15:09 russum joined #mojo
15:10 fhelmber_ joined #mojo
15:25 basiliscos joined #mojo
15:26 denis_boyun joined #mojo
15:26 rwstauner joined #mojo
15:47 Britzel_ joined #mojo
16:12 Britzel joined #mojo
16:17 fhelmber_ joined #mojo
16:17 jontaylor joined #mojo
16:18 delias joined #mojo
16:27 dod joined #mojo
16:33 dsteinbrunner joined #mojo
16:36 btyler joined #mojo
16:37 rem_lex joined #mojo
17:05 bpmedley joined #mojo
17:09 jpl how can I force UserAgent to send a cookie along with a request?
17:10 jpl cookie_jar seems to be for response cookies, isn't it?
17:18 denis_boyun_ joined #mojo
17:19 trone joined #mojo
17:21 sri http://mojolicio.us/perldo​c/Mojo/UserAgent#build_tx
17:23 jpl sri: thanks, but it doesn't seem to work (sends an empty "Cookie:" header
17:25 denisboyun joined #mojo
17:29 marcus_ batman: Sure.
17:30 jpl $tx->req->headers->cookie($cookie_string) works...
17:32 denis_boyun_ joined #mojo
17:36 denis_boyun_ joined #mojo
17:42 d4rkie joined #mojo
17:43 marcus_ sri: We plan to open source Mojo-IRC as soon as we've cleaned it up a little.
17:44 sri marcus_: what's Mojo-IRC?
17:44 marcus_ sri: IOLoop irc client we use in wirc.
17:44 sri oh, that's awkward, i've got one of those too
17:45 marcus_ \o/
17:46 marcus_ sri: I can give you mine now in case there's stuff you need, and we can switch to yours when it is out ;)
17:57 libsysguy joined #mojo
18:06 btyler joined #mojo
18:07 libsysguy does anybody have a recomendation on using socket.io with mojo websockets?
18:18 bowtie_ joined #mojo
18:19 Vandal I  want to scrap
18:20 libsysguy is that like fight?
18:20 Vandal I want to write script that scrapes 1000 of sites with Mojo::UserAgent, what can you recomend to speed things up
18:21 jontaylor_ joined #mojo
18:22 preaction why does it need to be fast? are you sending If-Modified-Since headers?
18:23 wsri joined #mojo
18:23 wsri joined #mojo
18:23 wsri :)
18:29 marcus_ wsri: yay
18:30 Mike-PerlRecruiter_ joined #mojo
18:30 marcus_ Mike-PerlRecruiter_: recruited many Perls lately?
18:42 jpl can i somehow convince hypnotoad to direct STDERR to its log file?
18:56 basiliscos joined #mojo
19:02 jamesw joined #mojo
19:02 basiliscos joined #mojo
19:29 sri marcus_: what's your take on the lack of healthy companies around irc?
19:32 denis_boyun joined #mojo
19:35 jontaylor_ joined #mojo
19:37 marcus_ sri: isn't irccloud and grove going ok?
19:37 marcus_ sri: I think it was very good for grove to be taken over by revolution software. I'm not so impressed by Leah Culver.
20:02 wk joined #mojo
20:14 batman marcus_: i will make mojo-irc github repo now.
20:21 batman https://github.com/jhthorsen/mojo-irc
20:21 batman sri: haven't move tests over yet, but feedback on the code is more than welcome
20:22 marcus_ sri: I shared it with sri already in a private gist. He says his code is simila
20:22 marcus_ similar
20:22 marcus_ that was for batman..
20:24 batman okidoki
20:26 perlite_ joined #mojo
20:28 punter joined #mojo
20:31 sri ah, most networks enforce a connection limit of 5
20:32 sri looks like what i was planning is not actually possible
20:33 sri with a channel limit as low as 20 for some i wouldn't be able to collect enough data
20:33 lukep joined #mojo
20:35 dod joined #mojo
20:40 bowtie_ joined #mojo
20:47 sri i suppose mibbit also counts as a successful irc company
20:48 sri marcus_: dunno about grove though
20:48 marcus_ sri: Just get more ips?
20:48 marcus_ sri: ec2 or whatever ;)
20:48 sri ;p
20:50 sri ec2 would actually be a terrible choice
20:50 sri way too expensive if you're only after ips
20:52 sri freenode is the most liberal network it seems, 5 connections and 120 channels
20:53 sri even then it's only 600 channels per ip i could index
20:54 sri guess to do it right you have to run a server on every network
20:54 jast what's your plan?
20:54 sri i wanted to try doing irclogs right
20:55 jast you pretty much only have the option of using many IP addresses unless you can get the network admins to cooperate
20:55 sri you know, widgets you could embed in your project page live streaming what's going on in the irc channel
20:56 jast yeah, that would be pretty cool
20:56 jast integrate commit notifications to IRC while you're at it :) that would be a nice package
20:57 sri github does that already
20:59 jast yeah, but they do the whole join/msg/part triplet every time
20:59 sri i wasn't planning on showing join/part
20:59 jast but people in the channel will see it :)
20:59 sri anyway, i don't think it can be done
21:02 MeierM joined #mojo
21:03 sri dammit... i want to do some heavy real-time web project to demonstrate what mojolicious is capable of :S
21:08 jast make your own chat system
21:09 sri well, it should also be *useful* ;p
21:12 jast I wouldn't mind a social network type thing that *doesn't* suck
21:12 jast small project ;p
21:13 sri "*useful*"
21:13 jast yeah, that's the "*doesn't* suck" part
21:13 sri building a social network is not a tech problem but a community building problem
21:14 jast yeah, to be more precise, what I'd love to see is an anti-social network of sorts
21:15 jast but for now the idea is far too vague to be useful as a project
21:43 marcus_ sri: Actually http://aws.typepad.com/aws/2012/07/m​ultiple-ip-addresses-for-ec2-instanc​es-in-a-virtual-private-cloud.html
22:12 sri marcus_: so about $4 per ip per month on top of normal ec2 costs
22:19 sri this irccloud post is also a bit scary https://blog.irccloud.com/n​ew-data-center-black-lotus/
22:43 jast for networks supporting IPv6, it might be easier to get a largish IPv6 subnet
22:49 sri good point, every hetzner server gets a free /64 subnet
22:51 jast I suppose /64 is problematic... technically each host is supposed to get their own /64 (the first 64 bits are the host identifier)
22:53 jast so IRC networks might end up treating each /64 as a single host
22:54 StinkfooT joined #mojo
22:56 sri :,(
23:02 rwstauner left #mojo
23:53 dsteinbrunner joined #mojo

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