Camelia, the Perl 6 bug

IRC log for #mojo, 2012-03-24

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

All times shown according to UTC.

Time Nick Message
00:31 GitHub87 joined #mojo
00:31 GitHub87 [mojo] kraih pushed 1 new commit to master: http://git.io/iTkd8w
00:31 GitHub87 [mojo/master] mention how to disable the routing cache - Sebastian Riedel
00:31 GitHub87 left #mojo
00:49 jamesw joined #mojo
01:39 xaka1 joined #mojo
01:54 tempire what's the purpose of disabling the routing cache?
02:05 sri tempire: to make routes slower
02:05 sri but it's also important for conditions
02:05 sri since routes with conditions can't be cached we have to disable the routing cache automatically
02:07 sri https://github.com/kraih/mojo/blob/mast​er/lib/Mojolicious/Routes/Route.pm#L118
02:07 sri i mostly wanted to make clear that ->cache(0) can happen
02:17 tempire are there any free services for redis like there is mongohq for mongo?
02:17 tempire marcus ^
02:18 sri unlikely
02:18 sri in-memory is expensive
02:19 sri http://redistogo.com/ # $5 for 20mb ;p
02:20 sri hmm
02:20 sri http://redis4you.com/ # 5mb free
02:20 tempire website looks questionable
02:20 tempire but if it works...
02:24 athenot joined #mojo
02:49 mire_ joined #mojo
03:21 abra joined #mojo
04:54 Psyche^ joined #mojo
05:18 kaare joined #mojo
07:04 Mrono How do I do a non blocking, long running UA request
07:07 tempire http://mojolicio.us/perldoc/Mojolic​ious/Guides/Cookbook#Non2Dblocking
07:07 tempire or http://mojolicio.us/perldo​c/Mojo/UserAgent#SYNOPSIS
07:09 Mrono I was looking at the useragent one
07:10 Mrono except when I try to do it, I still get a super long delay on clients connecting to the websocket because of it
07:10 Mrono what about non blocking fork waiting and getting data from a fork
07:11 tempire are you calling ->wait?
07:12 Mrono I don't know how to do that with waitpid
07:12 tempire no, regarding the ua synopsis example.
07:12 Mrono I have 4 forks running on a 15 second timer
07:12 Mrono one sec, i'll paste my code
07:18 tempire I'm off
07:18 tempire but regardless, forget the fork
07:19 tempire mojo uses an event loop, so fork doesn't make any sense.
07:20 Mrono well here's my thing
07:20 Mrono when I run http://pastebin.com/kBN2A5UJ I get an error that the loop has already started
07:21 tempire ack
07:21 tempire get it down to a minimal case
07:22 Mrono sorry, #perl always wants the entire thing
07:23 tempire I would bet you don't want parallel requests using delay, but just want non-blocking.
07:23 Mrono I don't follow
07:24 Mrono it's 130am for me, sorry
07:25 Mrono I want to run the calls every 15 seconds, not run if they are already going, and not block requests that the websocket server is getting
07:25 tempire in this example, it looks like you're initiating a request, and then waiting for it with $delay->wait
07:25 Mrono yes
07:32 Mrono how do I run that inside a loop and non-blocking
07:39 tempire I would use the cookbook example...I think it fits more what you're trying to do.
07:40 Mrono which one
07:40 Mrono the non-blocking parallel requests?
07:40 tempire http://mojolicio.us/perldoc/Mojolic​ious/Guides/Cookbook#Non2Dblocking
07:44 Mrono this is so confusing lol
08:10 Mrono I'm so confused
08:10 Mrono I wrote a simple page with a 5 second sleep timer on it then it prints the time
08:10 Mrono a cgi page for it to pull
08:10 Mrono somehow it's bypassing the timer after the first call
08:38 diegok Mrono: cgi and async?
08:39 Mrono diegok: it's not doing what I thought it was
08:39 diegok Mrono: can you try using morbo for example?
08:40 Mrono diegok: still having issues doing 4 async UA calls inside a reoccuring timer while waiting for the return of all 4 to finish the timer
08:41 diegok Mrono: which kind of issues?
08:41 Mrono they don't wait
08:41 Mrono the timer just keeps going and calls more, regardless of if they finished the last time yet
08:42 diegok Mrono: your code is still what you've pasted earlier?
08:42 Mrono no, i'll post new stuff
08:42 diegok :)
08:43 Mrono the main thing is that I have no clue what's going on in the example
08:44 diegok Mrono: which example?
08:44 purl which example is that?
08:45 Mrono async non blocking UA
08:45 Mrono http://mojolicio.us/perldoc/Mojolic​ious/Guides/Cookbook#Non2Dblocking
08:45 Mrono http://pastebin.com/WNXVjAwq
08:46 Mrono the link at http://cloud.mrono.net/cgi-bin/test.cgi delays for a random between 1-10 then returns the time
08:47 Mrono Here is what I am trying to do
08:47 Mrono start 4 different non-blocking UA calls
08:48 Mrono wait for them all to finish (and handle the output for each) then wait for the timeout and do it over again
08:48 mire_ joined #mojo
08:48 diegok Mrono: cgi?, I think using CGI goes against having an event loop running...
08:48 Mrono diegok: no cgi
08:49 Mrono diegok: the cgi is just a page that i'm using to make a fake delay for the UA to hit
08:49 diegok Mrono: ok, sorry :)
08:50 Mrono previously I have done this with fork() and waitpid()
08:50 Mrono but that obviously won't work with non-blocking
08:53 diegok Mrono: what are you trying to achieve?
08:53 diegok you have no routes, right?
08:53 Mrono I don't even know how to do routes
08:54 Mrono I'm trying to do 4 non-blocking UA calls and wait for them to finish then wait for x seconds and do it again
08:54 diegok Mrono: ok, so you don't need any mojolicious, just mojo::useragent
08:55 Mrono I will need Lite as i'll be doing a websocket server if that's what you mean by routes
08:58 diegok ok, so... you'll have a web app that every 5 seconds will fetch 4 urls and also have a ws action?
08:58 Mrono i never said webapp
08:59 diegok ok, that websocket will talk to another program?
08:59 Mrono it's a websocket server
09:00 diegok so, there will be clients connected to that ws
09:00 Mrono yes
09:00 diegok ok.
09:00 Mrono which is why I need it to be non-blocking UA calls
09:00 Mrono http://pastebin.com/6ujyHfGT
09:00 Mrono that's everything
09:01 diegok ok, that is no doing what you want, I'm trying to understand what you want to be helpfull.
09:01 Mrono perfectly acceptable
09:02 Mrono it's a websocket server that polls 4 webpages and pushes the data out to connected clients
09:02 diegok and, you will be writing to your ws clients every time you poll that 4 pages?
09:02 Mrono yes
09:02 diegok ok :)
09:04 diegok Mrono: I think you need to set a recurring timer using somethink like this recipe: http://mojolicio.us/perldoc/Mojolicious/G​uides/Cookbook#Parallel_blocking_requests
09:05 diegok and then a route like this: http://mojolicio.us/perldoc/​Mojolicious/Lite#WebSockets
09:05 Mrono diegok: when I try to use that it errors because it's already inside a loop timer
09:06 Mrono and i've already got the writing to the websocket clients done
09:06 diegok Mrono: you'll have to store ws connections on a global var so you can talk to them on every lecture
09:06 Mrono i've done all that
09:06 Mrono just need help with the UA
09:06 diegok your pasted code is not doing this
09:06 Mrono yes it is
09:07 Mrono it's storing the clients in $clients
09:07 Mrono which I can send to whenever
09:12 diegok Mrono: ok, I'm doing some testing
09:14 Mrono k
09:25 Mrono using delay->begin and wait will work if I can embed it inside a recurring timer
09:34 Mrono diegok: any luck?
09:35 diegok Mrono: now i'm seeing the "Mojo::IOLoop already running" :)
09:35 diegok let me see.
09:51 diegok Mrono: https://gist.github.com/2180712
09:52 Mrono hmm interesting
09:52 diegok Mrono: Not sure if I can use delay on a running ioloop, but this works great.
09:52 Mrono lets see what happens
09:52 diegok ^ that works and the final result is the same as in the delay example.
09:58 Mrono it's not waiting to start the next call
10:01 Mrono diegok: http://pastebin.com/xG5Ek0gb
10:01 diegok Mrono: well. It's recurring every 5 independent of 4 reqs time
10:01 diegok you can change recurring for re-setting timer
10:01 Mrono here's how it should go
10:02 Mrono requests page....waits.....finishes THEN waits for the timout and restarts
10:04 Mrono it's not waiting for the UA requests to finish before it starts counting down again
10:08 diegok Mrono: https://gist.github.com/2180712
10:09 diegok there you go
10:09 Mrono so it waits 5 seconds, then calls it's self?
10:09 Mrono interesting
10:09 diegok this will set a timer at start and re-set the timer every time requests and ws anounce finish
10:11 Mrono yeah that works
10:11 Mrono almost feels dirty for having to do it like that though
10:12 Mrono thank you :)
10:13 diegok Mrono: dirty?, I love mojo for let me do this things so easy :)
10:13 Mrono diegok: dirty as in why couldn't it just let me use a recurring timer and the delay->wait
10:14 diegok it let you do that !
10:14 diegok but you should understand recurring
10:14 diegok recurring will never wait, it will recur :)
10:15 Mrono recurring waits till the code in sub{} finishes
10:15 diegok delay->wait looks like not made for inner-ioloop :)
10:15 diegok nop
10:15 diegok Mrono: recurring is more like a cron task
10:15 Mrono hmm
10:16 * diegok async is hard, let's go shopping!
10:17 diegok Mrono: actually, we are never stopping, the recurring task is indeed finishing earlier
10:18 diegok that finish long before the last requests finish, $running reach 0 and action happen.
10:18 Mrono ah
10:18 diegok do you understand what's happening here?
10:18 Mrono I do now
10:19 diegok great! :)
10:24 athenot joined #mojo
10:40 Mrono diegok: want to see it in my program?
10:50 * sri yawns
10:52 sri diegok: http://mojolicio.us/perldoc​/Mojolicious/Controller#ua # the delay example here is more convenient than a counter
11:01 Mrono sri how does the pausing on that work
11:01 sri what's pausing?
11:02 Mrono nevermind
11:06 batman joined #mojo
11:16 Mrono How do I send post data via UA
11:25 sri http://www.amazon.co.jp/gp/product/3848200953 # interesting
11:28 abra joined #mojo
11:28 sri looks like actually original content :o
11:30 sri http://www.amazon.de/Web-Entwicklung-mit-P​erl-Mojolicious-Starthilfe/dp/3848200953/
11:30 diegok sri: oh!, I was looking for that on the docs before doing the counting thing :(
11:32 diegok Mrono: you mean pausing to the re-setting timer?, It will be the same. This is the 'delay' usage I wanting before I've recommended you to use the counting trick :)
11:42 diegok Mrono: I've updated my example to use delay as sri have recommended ;-)
11:44 Mrono diegok: this is what i've got right now http://pastebin.com/xw2LGvQH
11:44 Mrono based on what he said
12:00 taryk joined #mojo
12:07 taryk joined #mojo
12:27 diegok Mrono: ok, that's without the mojolicious::lite (ws) part. What I've pasted is something close to what you've described you wanted to achieve ;)
12:28 diegok Mrono: now, you can pick what works for you.
12:34 diegok Mrono: https://gist.github.com/2180712
12:39 sri it's kinda fascinating that everybody starting with event loops will try to block the loop
12:44 sri it totally deserves a FAQ answer, but i have no idea how to put it in 1-2 sentences
12:57 sri hmm
12:57 * sri wonders if Mojo::Command->start_app('MyApp') would make sense
12:58 sri would remove the need for messing with $ENV{MOJO_APP} in application scripts
13:01 geck hat i've got right now http://pastebin.com/xw2LGvQH
13:01 geck 06:44 < Mrono> based on what he said
13:01 geck 07:00 -!- taryk [~taryk@180-227-105-89.dsl.lviv.farlep.net] has joined #mojo
13:01 geck 07:05 -!- taryk [~taryk@180-227-105-89.dsl.lviv.farlep.net] has quit [Quit: KVIrc 4.1.1 Equilibrium http://www.kvirc.net/]
13:03 sri geck: don't let the cat sleep on your keyboard
13:08 GitHub91 joined #mojo
13:08 GitHub91 [mojo] kraih pushed 1 new commit to master: http://git.io/zasupw
13:08 GitHub91 [mojo/master] added start_app method to Mojo::Command - Sebastian Riedel
13:08 GitHub91 left #mojo
13:09 sri makes the examples look better imo :)
13:10 inokenty There is no limit to perfection
13:14 GitHub27 joined #mojo
13:14 GitHub27 [mojo] kraih pushed 1 new commit to master: http://git.io/gFYx3g
13:14 GitHub27 [mojo/master] explain why conditions disable the routing cache - Sebastian Riedel
13:14 GitHub27 left #mojo
13:46 inokenty Wow, List::Gather is a nice module. Simple and very useful for me
14:06 GitHub70 joined #mojo
14:06 GitHub70 [mojo] kraih pushed 2 new commits to master: http://git.io/Hv0y3Q
14:06 GitHub70 [mojo/master] fixed small bugs in Mojo::Command and Mojolicious::Commands - Sebastian Riedel
14:06 GitHub70 [mojo/master] added command tests - Sebastian Riedel
14:06 GitHub70 left #mojo
14:12 sri the Mojo::Command/Mojolicious::Commands relationship is still a little weird, but i don't think i can move more code without breaking something
14:14 sri Mojo::Command as base class for actual commands, and Mojolicious::Commands for command discovery and running
14:14 sri it's not that bad, just not perfect
14:20 sri deprecating Mojo::Command in favor of Mojolicious::Command would make sense, but i don't think it's worth it
14:25 GitHub116 joined #mojo
14:25 GitHub116 [mojo] kraih pushed 1 new commit to master: http://git.io/eaFLaQ
14:25 GitHub116 [mojo/master] Mojolicious::Commands does not need to inherit from Mojo::Command - Sebastian Riedel
14:25 GitHub116 left #mojo
14:44 GitHub119 joined #mojo
14:44 GitHub119 [mojo] kraih pushed 1 new commit to master: http://git.io/65A4Tw
14:44 GitHub119 [mojo/master] mention which methods are meant to be overloaded in subclasses - Sebastian Riedel
14:44 GitHub119 left #mojo
14:58 GitHub193 joined #mojo
14:58 GitHub193 [mojo] kraih pushed 2 new commits to master: http://git.io/GRgrJA
14:58 GitHub193 [mojo/master] fixed generate command - Sebastian Riedel
14:58 GitHub193 [mojo/master] updated makefile generators - Sebastian Riedel
14:58 GitHub193 left #mojo
15:06 GitHub72 joined #mojo
15:06 GitHub72 [mojo] kraih pushed 1 new commit to master: http://git.io/QLRR2Q
15:06 GitHub72 [mojo/master] startup is also meant to be overloaded in a subclass - Sebastian Riedel
15:06 GitHub72 left #mojo
15:39 robinsmidsrod joined #mojo
15:46 Psyche^ joined #mojo
15:54 inokenty joined #mojo
16:36 xenu_ joined #mojo
16:54 Foxcool joined #mojo
16:57 sri joined #mojo
17:05 Mrono sri: How do I do curl -d "param1=value1&param2=value2" http://example.com/resource.cgi with useragent?
17:05 Mrono I can't figure out how to pass it the post data
17:06 Mrono and define Content-Type:application/json
17:18 xaka joined #mojo
17:23 black joined #mojo
17:24 inokenty Mrono: $ua->get("http://example.com/res.cgi?p1=v1&amp;p2=v2", { 'Content-Type' => 'application/json'} => sub { ... });
17:24 inokenty Mrono: http://mojocasts.com/e5
17:24 purl i heard http://mojocasts.com/e5 was giving me a solid white page on ubuntu 11.10/chromium 15
17:26 avenj joined #mojo
17:29 tempire I don't know about that mojolicious book
17:29 tempire there's not even a rainbow on the cover
17:34 GitHub58 joined #mojo
17:34 GitHub58 [mojo] kraih pushed 1 new commit to master: http://git.io/Zdy6vA
17:34 GitHub58 [mojo/master] made Mojo::IOLoop examples a little more versatile - Sebastian Riedel
17:34 GitHub58 left #mojo
17:38 kaare joined #mojo
17:38 sri anyone using EV on linux?
17:39 sri i would appreciate a "TEST_EV=1 prove -l t/mojo/reactor_ev.t" run
17:40 Mrono why isn't this working http://pastebin.com/kG3j2UX
17:40 Mrono When it runs, the last message I get is 'Fetching for ...'
17:40 Mrono then nothing
17:40 purl then nothing is nothing
17:41 inokenty Mrono: Dead link
17:41 purl hmmm... Dead link is due to hard drive error on that server.
17:41 Mrono http://pastebin.com/kG3j2UXv
17:42 sri actually, i would also appreciate runs of "prove -l t/mojo/reactor_poll.t" on all other platforms
17:42 sri last release might be very broken
17:43 sri i've got 3 reports from people that can't give me any details whatsoever...
17:43 sri it's rather frustrating
17:44 tempire redhat 5.10.1 reactor_poll passes tests
17:44 sri http://www.cpantesters.org/distro​/M/Mojolicious.html#Mojolicious-2.68 # and for some reason the progress bar here is very very red
17:44 sri tempire: thanks, any other fails?
17:45 tempire oh, I didn't have ev installed
17:46 tempire what's the ev package for apt-get?
17:47 Mrono when I run the above paste it also doesn't even hit the server
17:47 sri libev-perl would be my guess
17:48 sri hope the new one_tick semantics didn't break too much :/
17:52 tempire https://gist.github.com/2185585
17:53 tempire 1 test fail
17:53 tempire 5.10.1
17:53 sri damn
17:53 sri Y U NO WAIT EV!
17:56 sri tempire: "perl -MMojo::Reactor::EV -E'my $r = Mojo::Reactor::EV->new; $r->timer(5 => sub {warn "5 seconds later!\n"}); $r->one_tick'"
17:56 sri can you run that?
17:57 sri and then maybe "perl -MMojo::Reactor::EV -E'my $r = Mojo::Reactor::EV->new; $r->timer(5 => sub {warn "5 seconds later!\n"}); $r->start'"
17:57 tempire runs, finishes
17:57 tempire no warn
17:57 sri shit
17:57 sri that means EV is broken
17:57 sri which EV version?
17:58 tempire the second one prints 5 seconds later
17:58 tempire libevent-1.4-2
17:58 sri that's not ev
17:59 sri libev != libevent
17:59 sri that's the second time i have to say that today :)
17:59 sri "mojo version" if in doubt
17:59 sri i think EV::RUN_ONCE is broken in the version you're using
18:00 sri i have 4.11 (the latest)
18:00 tempire 4.11
18:00 sri :(
18:00 inokenty On Arch Linux both examples runs flawlessly
18:01 inokenty The same version of EV
18:01 tempire I switched to ubuntu, by the way.
18:01 sri inokenty: thanks, that's very interesting
18:01 d4rkie joined #mojo
18:01 sri inokenty: perl and ev version?
18:01 sri tempire: same perl and ev version?
18:02 tempire perl 5.10.1.  ev 4.11.  the one_tick doesn't warn.  the start does.
18:02 sri ok
18:02 inokenty sri: Perl 5.14, EV 4.11
18:02 * sri tests on 5.14 too
18:03 sri ok, not sure there is anything we can do
18:04 sri i could make the tests pass more easily, but that doesn't really gain us anything
18:06 sri tempire: "perl -MEV -E'my $t = EV::timer(5, 0, sub {warn "5 seconds later!\n"}); EV::run(EV::RUN_ONCE)'"
18:06 sri that should trigger the specific problem
18:06 sri (as in exit instantly)
18:07 tempire https://gist.github.com/2185585
18:09 * sri nods
18:09 sri confirmed it is then
18:18 GitHub91 joined #mojo
18:18 GitHub91 [mojo] kraih pushed 1 new commit to master: http://git.io/07vRBg
18:18 GitHub91 [mojo/master] improved Mojo::Reactor tests by making them less strict - Sebastian Riedel
18:18 GitHub91 left #mojo
18:19 sri ok, apparently it was silly of me to expect RUN_ONCE to actually work :)
18:20 Mrono sri: how do I disable SSL checking with UA?
18:20 Mrono like $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = "0";
18:24 sri anyone having any normal test fails for 2.68?
18:25 sri perhaps on some version of bsd?
18:27 Mrono noe
18:28 sri i think that red bar on the cpantesters page just wants to taunt me -.-
18:28 inokenty Arch Linux => All tests successful
18:28 sri what the hell is mirbsd?
18:28 sri http://www.cpantesters.org/cpan/report​/816874ca-75c9-11e1-8755-e63c2a028b78
18:28 sri failing test is now live
18:28 Mrono how do I do $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = "0"; in mojo useragent
18:36 inokenty Debian Lenny => All tests successful
18:37 sri \o/
18:38 sri i'm 99% sure it's unicode/regex bug in perl
18:38 sri since dom.t segfaulted
18:38 sri just confirmed with the tester
18:40 inokenty sri: eval 'use Mojo::Reactor::EV; 1' <- Why do you add '1' at the end? =)
18:41 sri ensure a true return value
19:03 xaka joined #mojo
19:37 sri http://news.ycombinator.com/item?id=3750060 # oh, looks like youporn is no longer a catalyst app :(
19:39 sri which reminds me
19:40 sri marcus: you still owe me some details about that hypnotoad vs fcgi benchmark
20:00 jwang it's interesting they've been posting more about their infrastructure
20:01 jwang slides 3 and 5 are interesting. it was a Cat app from inception through acquistion
20:01 jwang it was rewritten after it was acquired
20:01 jwang like Delicious
20:13 perlite_ joined #mojo
20:38 GitHub107 joined #mojo
20:38 GitHub107 [mojo] kraih pushed 1 new commit to master: http://git.io/C6d-zA
20:38 GitHub107 [mojo/master] improved Mojo::DOM::CSS performance - Sebastian Riedel
20:38 GitHub107 left #mojo
20:55 cstamas hi
20:55 baton8 joined #mojo
20:56 cstamas how can I set an option 'selected' with TagHelpers?
20:58 cstamas I read the code and seems like that the functionality is here
21:00 Foxcool joined #mojo
21:09 cstamas maybe it automatically looks for submitted paramaters?
21:09 cstamas :)
21:10 inokenty cstamas: It searches values in $self->param
21:11 inokenty cstamas: http://pastebin.com/QbHCByHg
21:12 inokenty The selected item is 'de'
21:12 cstamas I have just realized a few seconds ago
21:12 cstamas wow
21:12 cstamas :)
21:13 cstamas then thing is that it automatically works for submitted values
21:13 cstamas as far as I see
21:13 cstamas and this is good :)
21:14 cstamas so it picks up already submitted ones as selected
21:15 cstamas inokenty: thx
21:21 GitHub175 joined #mojo
21:21 GitHub175 [mojo] kraih pushed 1 new commit to master: http://git.io/5SW9ng
21:21 GitHub175 [mojo/master] more Mojo::DOM::CSS optimizations - Sebastian Riedel
21:21 GitHub175 left #mojo
22:31 GitHub45 joined #mojo
22:31 GitHub45 [mojo] kraih pushed 1 new commit to master: http://git.io/ZIA7iA
22:31 GitHub45 [mojo/master] changed subclassing hints a little - Sebastian Riedel
22:31 GitHub45 left #mojo

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