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

IRC log for #mojo, 2015-02-03

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

All times shown according to UTC.

Time Nick Message
00:03 jberger ftw is that?!
00:04 Grinnz doing some benchmarking with that wrk program... Mojo::Reactor::POE with poll backend gets about 67% the req/sec of Mojo::Reactor::Poll, and Mojo::Reactor::IOAsync with poll backend gets about 85%
00:05 Grinnz Mojo::Reactor::EV with poll backend gets 114% in this comparison :P
00:26 Grinnz side note: POE's loop autoloading algorithm makes things a lot more fun
00:27 preaction dotan: for that app, it uses the output of Pod::Simple::XHTML, but yeah, now that i see it, that's not exactly the best representation of that construct (but POD's bulleted list isn't exactly the greatest either)
00:27 Grinnz by virtue of Mojo::Reactor by itself loading IO::Poll, that becomes the default loop for POE, and if you have POE::Loop::Mojo_IOLoop installed you cannot actually load Mojo::Reactor::POE unless you've set POE's event loop explicitly
00:27 Grinnz lulz
00:27 preaction (9 hours 27 minutes later!)
00:29 preaction dotan: it looks okay to me on Safari though. what browser did i neglect to check? also, perhaps #statocles?
00:53 cpan_mojo Mojo-Reactor-POE 0.005 by DBOOK - http://metacpan.org/release/DBOOK/Mojo-Reactor-POE-0.005
00:54 asarch joined #mojo
00:54 Grinnz ^ fixed the problem on my end at least
00:59 asarch I have this small Dancer-based app to dispatch the local documentation of the GTK+ 2.x in HTML: http://paste.scsys.co.uk/461614
01:00 asarch I am trying to do the same with Mojo with: http://paste.scsys.co.uk/461615
01:00 asarch However, I get http://paste.scsys.co.uk/461616
01:02 pink_mist asarch: why aren't you running that under a Mojolicious::Lite app? seems much more appropriate
01:02 asarch Questions: 1. Why Dancer gets the full file name, for example using "http://127.0.0.1:6490/gtk2-Keyboard-Accelerators.html", in its param: param('module') while Mojolicious only gives 'gtk2-Keyboard-Accelerators'?
01:02 preaction also why not reply->asset( $path )
01:02 pink_mist asarch: and you need to delimit your templates with either __END__ or __DATA__
01:03 asarch Actually, the Mojolicious data resides in its own file
01:03 pink_mist then why do you have <%= pato > at the end?
01:03 pink_mist remove it
01:03 asarch Servidor.pm for the Mojolicious configuration module, Root.pm for the root controller and archivo.html.ep for the template
01:04 asarch I just pasted all the data in a single post at http://paste.scsys.co.uk/
01:04 asarch But they are actuall three separate files
01:04 pink_mist ... the error you're gettig says you have that in your code.
01:05 pink_mist oh wait never mind
01:05 asarch This is the actual tree structure: http://paste.scsys.co.uk/461617
01:05 pink_mist I can't properly read
01:06 pink_mist asarch: anyway, that pato you have in your template; that's not valid perl unless you've made a subroutine with that name ... which you haven't
01:06 asarch Ok, let me re-paste the info
01:06 asarch 'pato' should be a subroutine?
01:06 pink_mist you've added a pato to the stash, but that won't be accessed by trying to run pato()
01:06 pink_mist that's accessed by $pato or stash('pato')
01:07 asarch Then why in the index sub, data works fine: $self->stash(data => <$in>);
01:07 asarch ?
01:07 pink_mist asarch: "should" is too strong a word. you're using it as a subroutine.
01:07 pink_mist you shouldn't be using it as a subroutine.
01:07 Grinnz "data" is a reserved word; don't use it
01:07 asarch Look at the line # 42: http://paste.scsys.co.uk/461615?ln=on&amp;submit=Format+it!
01:07 Grinnz https://metacpan.org/pod/Mojolicious::Controller#stash
01:08 asarch Oh :-(
01:08 preaction why not $self->reply->asset( $file_path )? why read the file at all? let mojolicious read the file for you
01:08 Grinnz (relative to your $app->static->paths
01:08 Grinnz )
01:08 pink_mist asarch: that "data" is not something you're trying to access from a template.
01:09 asarch Oh
01:09 asarch I see
01:09 preaction and it wouldn't work like that due to perl's list flattening anyway
01:09 asarch I changed that name to 'perro' and I got the same error: Bareword "perro" not allowed while "strict subs" in use at template root/index.html.ep line 5, <$in> chunk 1.
01:09 Grinnz yeah, with that line you're going to end up with a whole list of each line from $in in your stash
01:09 pink_mist asarch: so STOP trying to use it as if it were a subroutine
01:09 pink_mist use it like it's meant to be used
01:10 pink_mist asarch: $perro
01:10 pink_mist asarch: stash('perro')
01:10 asarch Ok
01:10 pink_mist either of those should work fine
01:10 pink_mist but just perro
01:10 asarch Yeah, <%= $perro %> worked
01:10 pink_mist is not valid perl unless you have defined a subroutine with that name, which is not what you wanted.
01:10 pink_mist so stop doing it with just perro
01:11 Grinnz asarch, do not use the <> operator in a list (like in the stash function)
01:11 pink_mist where did you even read something to make you think that would work?
01:11 asarch Well, I saw <%= content %> in the main layout and I thought I could... :'-(
01:12 * asarch thought it was like TT...
01:12 Grinnz that calls a subroutine, not a stash value
01:12 Grinnz https://metacpan.org/pod/Mojolicious::Plugin::DefaultHelpers#content
01:12 asarch That was a *NASTY* solution just for debugging purposes Grinnz
01:13 Grinnz asarch, you need to be really careful with context sensitive operators like that in lists
01:13 Grinnz pato => scalar <$in> would work, or assigning it to a scalar beforehand
01:14 good_news_everyon joined #mojo
01:14 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/bI3E
01:14 good_news_everyon mojo/master ce13a6a Sebastian Riedel: add content_security_policy method to Mojo::Headers
01:14 good_news_everyon left #mojo
01:14 asarch Well, I used <$in> to store binary file format (from a JPEG file) in a SQLite3 DB
01:15 Grinnz well first of all, you'll want to binmode that filehandle
01:15 asarch unset $/; $schema->resultset('Images')->add(content => <$in>);
01:16 Grinnz ah, with $/ undef i guess you wouldnt get multiple lines
01:16 jberger unset?
01:16 purl rumour has it unset is a shell command
01:16 jberger local
01:16 jberger thanks purl
01:16 Grinnz lol
01:16 jberger that makes sense
01:17 preaction asarch: that works only incidentally. that jpeg didn't have the magic sequence of line-ending bytes in the right place
01:17 asarch How is the correct way?
01:18 preaction oh, local $/; ... if you change the _rules_, of course you can win
01:18 Grinnz binmode $in; my $content = <$in>;
01:21 asarch Actually... binmode never... worked
01:21 * asarch hides
01:21 good_news_everyon joined #mojo
01:21 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/bIGK
01:21 good_news_everyon mojo/master d04e9db Sebastian Riedel: mention data as a reserved stash value
01:21 good_news_everyon left #mojo
01:21 Grinnz meaning?
01:21 purl well, meaning is in the individual, whether a definition of a word, connotation of a symbol, or impression of a painting.
01:21 asarch That's why I had to use: unset $/
01:22 Grinnz binmode does work, so something else is wrong
01:22 pink_mist asarch: "unset" $/? are you sure you're writing perl?
01:23 punter joined #mojo
01:24 asarch Of course! The image data got corrupted when I stored in binmode in the SQLite3 DB
01:24 asarch Actually, unset $/; is a solution from Perl Monks
01:25 good_news_everyon joined #mojo
01:25 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/bIZ7
01:25 good_news_everyon mojo/master 190d2d9 Sebastian Riedel: just mention the regular expressions in the tutorial
01:25 good_news_everyon left #mojo
01:25 Grinnz no, it's undef $/
01:25 Grinnz unset is not a perl function
01:25 asarch Yeah, sorry a typo
01:26 Grinnz sqlite has a blob datatype, that should not corrupt any data
01:26 asarch This is the file content I get with <%== $perro %>: http://paste.scsys.co.uk/461619
01:27 asarch Why it makes a character code conversion? "Part I. GTK+ Overview"
01:28 Grinnz that could be a lot of things, including what you're reading it with
01:28 pink_mist asarch: just let Mojolicious do the serving of the file instead of you reading it in and putting it in a stash and using a template to read it out
01:29 pink_mist and /then/ letting Mojolicious serve that
01:29 asarch Ok
01:30 asarch Is there any difference between $self->stash(perro...); and $self->render(perro...);
01:30 asarch ?
01:31 asarch And why $sef->param('archivo') doesn't get the ".html" of the GET message?
01:31 asarch Is there any way to enable it?
01:32 preaction param are get parameters. if it's a url part you want, that's in the stash
01:34 asarch However, it is not. Try to pass and address like "/Mojolicious.html" and you will see
01:34 pink_mist putting something in the satsh and giving a parameter to render are completely different things, asarch.
01:34 Grinnz you mean the /:archivo route
01:34 asarch Yeah
01:34 Grinnz you need to use relaxed parameters, /#archivo
01:34 pink_mist *stash
01:34 Grinnz otherwise . is not allowed
01:34 asarch THANK YOU
01:34 asarch A big thank you for that part
01:35 asarch (And for all the rest and for all of you)
01:35 Grinnz https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Routing.pod#Generic-placeholders
01:36 asarch So, I my $file = $self->param('archivo'); my $path = "/usr/share/gtk-doc/html/gtk2/$file"; $self->reply->asset($path) ?
01:37 Grinnz you need to set a relative path for static files
01:37 Grinnz and you want reply->static
01:38 Grinnz or you can use reply->asset but then you'd need to create an asset first
01:38 Grinnz https://metacpan.org/pod/Mojolicious::Plugin::DefaultHelpers#reply-asset
01:39 Grinnz https://metacpan.org/pod/Mojolicious::Guides::Rendering#Serving-static-files
01:39 asarch $r-get('/')-to('root#index'); and $r->get('/#archivo')->to('root#archivo'); are actually two different controllers, right?
01:39 good_news_everyon joined #mojo
01:39 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/bIlf
01:39 good_news_everyon mojo/master 84a9763 Sebastian Riedel: better example for relaxed placeholders
01:39 good_news_everyon left #mojo
01:40 Grinnz no, those both call the root controller and different action methods
01:40 asarch One for just / and the other for, for example, /Menu.html?
01:41 Grinnz with those two routes yes
01:42 asarch How can you force mojo to reload on every change? So far, I've been using morbo
01:42 Grinnz that's what morbo is for
01:42 asarch I see
01:43 Nemix you can specify where to look for files to reload on but for basic case it just worked for me
01:44 punter joined #mojo
01:46 asarch If I set $self->reply->asset("/advanced/Toolbar/Settings.html"); that means that I need to have the path "/advanced/Toolbar" and the file "Settings.html" in the <project>/public place, right?
01:46 asarch s/asset/static/
01:47 asarch I mean, that doesn't work for the local file system right?
01:49 Grinnz public is the default dir, yes
01:49 asarch Oh
01:49 Grinnz and remove the / at the beginning
01:52 asarch Is there a plugin for read files outside '/public'?
01:52 Grinnz you just set $app->static->paths
01:52 Grinnz https://metacpan.org/pod/Mojolicious::Static#paths
01:55 sri also http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Custom-responses
02:05 asarch use Mojolicious::Static; for the project module of just for every controller module?
02:06 Grinnz neither?
02:06 Grinnz the static object is in $app->static already
02:06 mst joined #mojo
02:07 asarch Ok
02:09 klapperl_ joined #mojo
02:13 asarch WOW!!!
02:13 asarch Thank you guys
02:13 asarch THANK YOU VERY MUCH :-)
02:13 asarch You are AWESOME
02:15 asarch Everything is simply fine :-)
02:15 sri https://www.youtube.com/watch?v=StTqXEQ2l-Y
02:17 mst sri: hey, last time I wanted part of Mojo standalone you told me to fork it
02:17 asarch The guy with beard in the videos, is that you sri?
02:18 mst sri: is http://paste.scsys.co.uk/461620 reasonable?
02:18 mst (yes I know it's fragile, dealing with the fragility on diff is my problem)
02:22 asarch http://vimeo.com/40579180
02:22 jberger awwww I forgot about tempire's beard
02:26 asarch You look a lot like Wart (actually King Arthur) from the Disney's "The Sword in the Stone" movie
02:27 tempire Behold my power.
02:27 tempire http://s3.amazonaws.com/auteurs_production/images/film/the-sword-in-the-stone/w856/the-sword-in-the-stone.jpg
02:28 jberger BLOW ME TO BERMUDA
02:29 jberger (wow, that phrase sounds worse now that I'm older)
02:35 good_news_everyon joined #mojo
02:35 good_news_everyon [mojo] kraih tagged v5.77 at 65d0135: http://git.io/bIiG
02:35 good_news_everyon left #mojo
02:35 tencendur joined #mojo
02:36 good_news_everyon joined #mojo
02:36 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/bIiE
02:36 good_news_everyon mojo/master 8efa1e4 Sebastian Riedel: bump version
02:36 good_news_everyon left #mojo
02:37 cpan_mojo Mojolicious 5.77 by Sebastian Riedel - http://metacpan.org/release/SRI/Mojolicious-5.77
02:55 sri mst: there is already JSON::Tiny
02:56 mst sri: yes. but I want an explicit autofork because if improvements happen, I'd rather share them
02:56 mst sri: I trust you to maintain Mojo usefully way more than I trust JSON::Tiny
02:57 mst sri: hence working hard to keep the code making my respect for your work here obvious
02:58 sri JSON::Tiny is one of the few forks that has been really well maintained
02:59 * sri shrugs
03:29 noganex joined #mojo
03:58 ribasushi joined #mojo
04:03 mtj- joined #mojo
04:05 Adurah joined #mojo
04:09 inokenty-w joined #mojo
04:23 inbioz joined #mojo
04:48 rem_lex joined #mojo
05:06 punter joined #mojo
05:08 s1037989 I just released an anonymous location-sharing web service, powered by Mojolicious.  Anyone care to see it?  The code is open source, too.
05:13 ovnimanc_ joined #mojo
05:13 punter s1037989, I'd like to see it
05:13 s1037989 http://be.gl
05:14 s1037989 Github: https://github.com/Stefan-Adams/be.gl
05:15 punter kewl
05:15 punter where's your location? It only shows mine
05:15 s1037989 St. Louis, MO
05:16 punter Wby doesn't it show you?
05:17 s1037989 Good question...  Lemme restart service...
05:18 s1037989 Hmm...  I've got my phone and laptop connected and both showing each other, but not you.
05:20 punter hm ok
05:20 s1037989 What browser?
05:20 purl browser is broken or http://www.gfd-dennou.org/library/cc-env/OLD/httpd_cern/
05:21 s1037989 It uses web sockets...
05:21 s1037989 And of course it relies on browser's geolocation.
05:21 s1037989 I've been testing only in Chrome.
05:26 punter Firefox, the latest one, on Ubunut
05:26 punter I'll try chrome now
05:27 punter Nope, there's just me on the map
05:27 punter Right now, 0 other beagles are active.
05:40 s1037989 Figured it out.  My nginx reverse proxy is too old...
05:41 s1037989 Does't support websockets.
05:41 s1037989 Try out my dev env
05:41 s1037989 https://be-gl-s1037989.c9.io
05:46 fhelmber_ joined #mojo
05:49 s1037989 Upgraded my nginx config to support websockets.  Good to go, punter.
06:05 reneeb joined #mojo
06:31 marmez joined #mojo
06:33 bwf joined #mojo
06:35 basiliscos joined #mojo
06:36 reneeb joined #mojo
06:42 rem_lex|pivo joined #mojo
06:58 bwf joined #mojo
07:18 cpan_mojo Mojolicious-Plugin-OnFork 0.003 by Bernhard Graf - http://metacpan.org/release/GRAF/Mojolicious-Plugin-OnFork-0.003
07:20 Grinnz that module is even simpler than my json one :)
07:23 dotandimet joined #mojo
07:23 dod joined #mojo
07:28 dod joined #mojo
08:01 eseyman joined #mojo
08:03 dotandimet joined #mojo
08:13 trone joined #mojo
08:14 Vandal joined #mojo
08:20 dotandimet joined #mojo
08:22 fromatoz joined #mojo
08:25 arthas joined #mojo
08:27 odc joined #mojo
08:59 amon joined #mojo
09:10 Dandre Hello,
09:10 Dandre I'd like to use EventEmitter on objects stored in database: In some controller I want to wait for some event on an entity that could occured in another controller.
09:10 Dandre I don't think I can use the stock EventEmitter as object instances are not the same. Must I use the Mojolicious hooks or is there some alternative?
09:24 inbioz joined #mojo
09:53 ilbot2 joined #mojo
09:53 Topic for #mojo is now ???? hear me roar | http://mojolicio.us | http://irclog.perlgeek.de/mojo/today
09:54 HtbaaPi joined #mojo
09:56 cpan_mojo Mojolicious-Plugin-Mango 0.0.2 by ZITSEN - http://metacpan.org/release/ZITSEN/Mojolicious-Plugin-Mango-0.0.2
10:00 reneeb Dandre: https://metacpan.org/pod/MojoX::GlobalEvents
10:01 melo joined #mojo
10:24 Dandre ok
10:30 batman Dandre: not that eventemitter does not work cross-process (meaning if you have hypnotoad or prefork)
10:31 batman Dandre: you need Mojo::Pg, Mojo::Redis2 or some other component that is able to do pubsub through a central location
10:38 Dandre ok thanks
10:45 pink_mist joined #mojo
11:15 sri hmm, so html5 animations are still -webkit prefixed
11:18 fhelmbe__ joined #mojo
11:18 sri fun collection of effects though http://daneden.github.io/animate.css/
11:20 reneeb joined #mojo
11:22 janus joined #mojo
11:22 ZadYree joined #mojo
11:22 ZadYree Hey!
11:22 odc link saved!
11:24 ZadYree I wonder if there is any way to write multi-line comments in mojo templates.
11:24 odc i feel like playing with powerpoint animations
11:26 buu <!-- comment -->
11:26 ZadYree it seems mojo tries to interprete them
11:26 ZadYree which I can't afford yet ^^
11:27 buu Oh I got nothing for actual template comments.
11:27 ZadYree Okay I've got a workaround
11:28 ZadYree I just made a reusable block, then commented its very call.
11:28 ZadYree it seems then mojo doesn't try to interpret it
11:45 sri if in doubt MOJO_TEMPLATE_DEBUG=1
11:49 marcusr then scream and shout.
12:09 da5id joined #mojo
12:18 fhelmber_ joined #mojo
12:26 dod1 joined #mojo
12:32 dod joined #mojo
12:36 Mikey joined #mojo
12:52 fhelmber_ joined #mojo
12:53 asarch joined #mojo
12:54 fhelmbe__ joined #mojo
13:05 neilhwatson joined #mojo
13:15 muraiki_ joined #mojo
13:16 cpan_mojo WWW-Crawler-Mojo 0.09 by Sugama Keita - http://metacpan.org/release/JAMADAM/WWW-Crawler-Mojo-0.09
13:24 sri i don't get it
13:24 sri why does Devel::Cover give different results when running over the same version twice?
13:25 sri 89% and 91.3%
13:25 purl 1.803
13:25 * sri slaps purl
13:25 purl o/` Hit me baby, one more time o/`
13:30 muraiki_ haha
13:32 tencendur joined #mojo
13:37 ignacio_ joined #mojo
13:43 * marcusr pushes purl down the stairs
13:43 purl Hey! *thump* ow! *bang* argh! *bam* son of a *thump* *crunch* whimper...
13:43 janus joined #mojo
13:43 jberger it's the whimper that always makes me a little sorry for her
13:43 jberger good morning o/
13:44 marcusr good morning, mr berger.
13:44 jberger doctor!
13:44 purl hmmm... doctor is Doctor Who? I'll go summon the tardis...
13:44 * marcusr summons the tardis too
13:44 marcusr it seems the doctor is in.
13:44 jberger who?
13:45 marcusr yes
13:45 jberger :-P
13:46 marcusr jberger: share the love?
13:46 purl share the love is at http://conferences.oreillynet.com/cs/eurooscon/view/e_sess/7497
13:46 marcusr oh shut up, purl.
13:46 purl Yes, sir.
13:47 * jberger hugs marcusr
13:47 marcusr purl: forget share the love
13:47 purl marcusr: I forgot share the love
13:47 sri wait... you get a tardis with your phd?
13:47 marcusr jberger: That is nice, even tho I was hoping for an @
13:47 jberger sri: of course, didn't you know that?
13:47 sri :o
13:48 jberger Bender trust marcusr
13:48 Bender OK, jberger
13:49 marcusr Bender: trust sri
13:49 Bender marcusr, I already trust sri
13:49 marcusr Bender: bend it
13:49 rofl_ thrust sri
13:50 marcusr sounds like a good competition for next mojoconf
13:51 jberger there was your problem!
13:52 marcusr indeed
13:54 marty joined #mojo
14:13 gryphon joined #mojo
14:24 jkramer He, I just read that Perl 6 is coming Christmas, this time (maybe) for real :D
14:24 jkramer Is mojo p6-ready already? :D
14:27 jberger jkramer: I know sri designed mojo with an eye for p6
14:27 jberger that said, the mood here after TimToady's FOSDEM talk was rather disappointed
14:27 jberger me included
14:29 genio are those talks on youtube?
14:29 btyler probably not yet. fosdem usually takes 4-6 weeks to upload, I think
14:30 odc not the best talk for newcomer indeed
14:30 btyler if you ask around in freenode #perl6, I think someone there has stream dumps from the perl devroom and larry's talk
14:30 genio booo.  YAPC++
14:31 odc jberger, did you see Ovid's talk?
14:31 ribasushi jberger: did you ever blog?
14:31 jberger odc: I wasn't able to see any of the talks
14:31 marty joined #mojo
14:31 jberger ribasushi: about the disappointment? no
14:31 jberger I held back
14:31 odc i see
14:31 ribasushi jberger: WEAK!
14:31 odc ovid's talk is much more practical and motivating
14:32 jberger the mood amoungst p6 folks was high, I didn't want to be the one to rain on the parade
14:32 jkramer jberger: Didn't see the FOSDEM talk, what was wrong with it?
14:32 jberger I might still post it
14:32 jberger jkramer: it was more promises
14:32 genio ah, so par for the course
14:32 jberger from a PR perspective, TimToady had to know the optics of another "this christmas ... we hope"
14:33 jberger I thought for sure that he was going to push an RC release
14:33 jberger because I thought he was smart/in-tune enough to know those optics
14:34 jberger the another perl5er that I respect reminded me that it just built another hurdle for p5
14:34 jkramer To be honest, last time I checked out p6 was when pugs was the way to go, rakudo didn't even exist then I think
14:34 jkramer But after that article I just built rakudo and started playing with it. Seems nice
14:35 genio I remember Damian Conway hyping p6 at OSCon in 2004/5 (can't remember exactly).  I was excited then.  Now, I've been more meh and skeptical about any talk of p6
14:35 jberger until they release Camelia (I no longer call it the other name) or rename it, every next round of promises is just another hurdle to getting the message out that perl (5) is alive and vibrant
14:36 jkramer What's camelia?
14:36 purl camelia is perl6's butterfly logo.
14:36 jkramer Yeah that's what I thought
14:36 jberger if you were a manager, and you saw that talk, would you commission a new project in p5?
14:36 jberger no
14:36 jberger but would you commission one in camelia? no, because you can't
14:37 jberger and THAT is my problem
14:38 jberger believe me, I want it to succeed
14:38 jberger I want to use it
14:39 jberger but I'm tired of having to clean up the mess ("don't complain, do something cool instead" --- I do, shut it)
14:39 ribasushi <jberger> if you were a manager, and you saw that talk, would you commission a new project in p5? <--- why?
14:39 ribasushi he didn't even mention p5
14:39 jberger ribasushi: because camelia is coming! its the new hotness
14:39 ribasushi ah, well... true
14:39 ribasushi I blame p5 for this, not p6
14:39 jberger ribasushi: maybe, but the naming doesn't help (and we are back to that again)
14:40 ribasushi our pr people are not differentiating themselves enough
14:40 jberger WE CAN'T
14:40 jberger HOW CAN WE
14:40 genio I completely blame it on the naming
14:40 jberger perl (5) is kicking ass lately
14:41 ribasushi jberger: we can, we just don't have the cohesion for /usr/bin/raptor (and /usr/bin/perl being a symlink to it, because nobody will dare to take on the codebase spread)
14:41 jberger I don't want to have to launch the name, we've had it for so long, but I'm getting ready
14:42 ribasushi why?
14:42 jberger and when we do I want strict by default (the only real change I want)
14:42 jberger because I'm sick of having to differentiate ourselves from Camelia
14:42 jberger if they admit it is a sister language, they should relent an take a new name
14:42 ribasushi the name we had for so long is associated with crazy syntax, simple oneliners (both 4, 5 and 6), with euler-project like toy solutions etc
14:42 jberger is that too much to ask?!
14:42 sri apparently it's really going to be perl 6.0.0
14:42 ribasushi I don't want to write an app in any perl
14:43 ribasushi I want to write an app in something else ;)
14:43 ribasushi which looks like perl5, and preferrably has my modules in it, and preferrably behaves the same way
14:43 jberger ribasushi: I'm saying I'm starting to get to your point of view, slowly
14:43 * ribasushi strokes beard - if only there was a way to get all that...
14:43 mst jberger: I'd point out here that when I tried to arrange for a rename to 'pumpkin perl' nobody helped at all except for xdg figuring out how to change the 'perl -v' output
14:44 mst so I'm not currently convinced anybody actually cares
14:44 jberger mst: you started my mind down this road
14:44 mst they just like claiming they care
14:44 jberger I'm not sure I was there until a couple days ago
14:44 mst I'm seriously considering reviving the proposal immediately after 5.22 ships
14:45 jberger if Camelia (and our absentee "bdfl") want the name, let them have it
14:45 genio Well, a vote from most of us (like myself) in your favor is basically worth nothing, mst.
14:45 jberger but I don't want to be competing with p5, I want the whole crew
14:45 ribasushi jberger: and the get to keep Matt's script archive (another Matt ;)
14:45 ribasushi *they
14:46 jberger ribasushi: a nice side benefit
14:46 ribasushi genio: I am trying to fix that (for real)
14:46 dod joined #mojo
14:46 jkramer Haha, I like the "Whatever Star" :D
14:46 btyler unfortunately there's already a CRAN
14:46 mst I didn't want votes. I wanted people to help me try and figure out where in the docs we needed to change the words
14:46 mst I put up a github repositories and promptly got completely ignored
14:46 mst I needed simple "read this POD and work out where to change the name" work
14:46 mst no power or heavy clue required
14:47 mst nobody even tried
14:47 genio mst: ah, I didn't know about that project.
14:47 ribasushi mst: don't channel Getty please - if nobody tried - it mans your message wasn't quite right
14:47 ribasushi bah kbd!!!
14:47 mst I got lots of comments on my blog posts and no patches
14:47 jberger mst: I'll admit to that, I didn't agree then
14:48 mst ribasushi: yeah, what annoyed me was the number of people saying "yes please" but not helping
14:48 mst or ... hrm
14:48 jberger I might still want to bikeshed the name a bit (hehe)
14:48 mst lemme put it another way
14:48 mst the ratio of "yes please" to actual help was poor compared to normally when I try and talk people into things
14:48 mst probably because spelunking through POD is BORING
14:49 genio indeed. but it's necessary
14:49 mst I think if I retry I'll attempt to get neilb to gamify it
14:49 jberger doesn't ack -l | perl -i fix a lot of that ?
14:49 mst "and a thousand copy editors cried out in agony, and were suddenly silenced"
14:49 jberger hahahahah
14:49 purl LOLCON 4.5 reached.
14:51 jberger mst: https://www.youtube.com/watch?v=0ymFxkFfIhU#t=441
14:51 jberger some of my favorite old-school camp
14:52 dotan s1037989: ReconnectingWebsocket looks useful, thanks
14:52 jberger dotan: I just saw that yesterday too
14:53 genio mst: Either way, if you decide to retry your renaming-fest, let me know and I'll donate time to updating POD
14:53 mst awesome.
14:54 genio That's simple enough stuff that I can do without much thought here and there when I need a break from work.
14:55 dod joined #mojo
14:55 jberger mst: I'm on board, and will help with the work, but I don't really want to see a fork I want the community backing to move perl5 in that new direction
14:56 mst jberger: that was the goal
14:56 jberger mst++
14:56 btyler but totally raptor over pumpkin /bikeshed
14:59 mst (1) the raptor thing already means "perl plus a certain aesthetic in terms of the code", to my mind
15:00 mst (2) "the pumpking's perl" is a pre-existed naming concept so it doesn't look like we're trying to hijack things
15:02 jberger so what do we call it (read: what do we google for)? pumpkin-lang?
15:02 mst I'd be happy enough with 'pumpkin perl' to start with
15:05 batman PLANG!
15:05 * batman hides
15:06 pink_mist perl#
15:06 marcusr ribasushi: actually he did mention perl5 several times, and said how perl6 was doing things better.
15:08 sri talking about software failures... mongodb 3.0 is out
15:09 odc what?!
15:09 jberger sri: I take it by your tone, that .... yeah
15:09 odc fugg
15:09 jkramer Broke Mango?
15:10 mst wait until version 3.23 and then it might actually be stable
15:10 sri jberger: yeah
15:10 odc jkramer, yes, Mango is for v2.6 until said otherwise
15:11 sri think i'll mark Mango for deletion on pause
15:11 odc sri, what are you trying to do here? :)
15:12 sri not have people complain to me that stuff doesn't work
15:12 sri in that dist i'm still listed as the maintainer, with links to my github repo
15:13 mst odc: PAUSE deletions take 3 days. you have until then to get your shit together and actually do an upload that lists it as your problem.
15:13 mst you've been meaning to get round to that for aaaages
15:13 mst a deadline is probably a good thing
15:13 mst help you stop procrastinating :D
15:13 odc rhaa
15:13 sri indeed marked for 3 days from now
15:14 odc just wait until this weekend please
15:14 marcusr the weekend starts 3 days from now =]
15:15 odc like my boss was intelligent enough to understand...
15:15 sri it's been over 4 months
15:17 sri actually, anyone who gets mango 3.0 ready can have co-maint too
15:18 * genio has no desire to do anything Mongo-related
15:18 odc sri, so if i did a release now Mango would be linked to me and not you anymore?
15:20 sri no, i keep first-come on the namespace until i give that up too
15:20 odc i see
15:20 janus joined #mojo
15:20 odc ok then do what you have to do
15:22 mst odc: you already have co-maint, correct?
15:22 sri he does
15:22 ZadYree Hello! I an trying to write a content block into my template but nothing gets written on the html page and still no error :(   Here is the  code chunk: https://gist.github.com/remi-armature/4909bbf2f201f892b4ba#file-gistfile1-pl
15:22 mst right, then the state of the permissions other than that is completely irrelevant
15:23 sri since september
15:23 mst the current blocker is odc's failure to actually do anything
15:23 jberger sri would have first-come, but the release would be under his name, and if he changes the docs and the repo metadata, it is his in all but first-come perms
15:23 dparry joined #mojo
15:23 mst odc: until you prove you're actually capable of doing a release, nothing else actually matters
15:23 mst odc: welcome to "JFDI is essential"
15:24 mst odc: I'm a horrible procrastinator too though, so hopefully the deadline will help :)
15:24 odc well if you insiste i can do a release with almost not change
15:24 dparry hey guys, trying to get websockets going and hitting "426 Upgrade Required". Any clues as to what that usually indicates. (Other than the requirement for an upgrade...)
15:24 mst odc: no change except to take responisibility for support - i.e. update the repo etc.
15:25 mst odc: that's the release sri's been asking you for for months
15:25 odc yup, and 1 small bugfix
15:26 dparry should add this is conencting with a Mojo UserAgent
15:28 sri dparry: that's what it indicates
15:29 dparry upgrade of... mojolicious? the server and client should be at the same version...
15:30 marcusr no, you need to upgrade from a normal http request to a websocket
15:31 dparry where does the upgrade happen in http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#WebSockets ?
15:32 pink_mist when you do $ua->websocket()?
15:32 dparry which afaics is what I am doing...
15:32 Grinnz_ "HTTP upgrade" is a websocket terminology
15:33 sri http://en.wikipedia.org/wiki/WebSocket#WebSocket_protocol_handshake
15:33 dparry running with daemon make any difference?
15:37 irq joined #mojo
15:38 dparry ah, looks like it was a route "collision"
15:38 dparry now working :)
15:38 dparry thanks for your help!
15:39 dparry I guess the initial request is a GET and that was swallowed by a get route whereas I thought it would come through always as websocket in the match
15:40 dparry so I guess a get route and websoket route with different purposes can't co-exist in the same namespace
15:41 sri they can
15:41 sri just put the websocket first
15:43 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#WebSockets
15:44 dparry ah, gotcha, thanks sri
15:57 sh4 joined #mojo
16:05 sri looks like xdg might want to maintain mango
16:08 Ptolemarch joined #mojo
16:24 jberger that would be cool
17:01 odin22 joined #mojo
17:04 xdg joined #mojo
17:06 Ptolemarch joined #mojo
17:13 fhelmber_ joined #mojo
17:16 good_news_everyon joined #mojo
17:16 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/bYPy
17:16 good_news_everyon mojo/master 054a265 Sebastian Riedel: show actual WebSocket handshake in the routing guide
17:16 good_news_everyon left #mojo
17:17 sri not sure if that's too much information
17:17 sri does look kinda nice though http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#WebSockets
17:48 Grinnz_ i like it, insight into whats actually going on
17:49 Grinnz_ i just converted our git webhook script to use a Mojo::IOLoop delay to synchronize posting each commit \o/
17:49 Grinnz_ first time ive had a use for nonblocking useragent :P
17:51 Ptolemarch joined #mojo
17:51 Grinnz_ also, +1 for the json generator, first time ive used that in a real application as well
17:59 Grinnz_ i kind of wanted to be able to send "context" along with each request, but since they're ordered, i just put context hashes into an array in $delay->data
17:59 Grinnz_ i suppose the parameters of the next delay step would get too busy otherwise
18:06 dotandimet joined #mojo
18:21 Ptolemarch joined #mojo
18:37 dotandimet joined #mojo
18:44 Grinnz_ just throwing this out there... what about a $delay method like begin, but instead its argument is a sub ref (closure, for this purpose) which takes the args passed to the callback and returns the arg(s) to send to the next step
18:46 Grinnz_ i.e. $delay->somemethod(sub { return { type => $type, tx => $_[1] })
18:46 Grinnz_ except without the syntax error
18:48 cpan_mojo Mango 1.15 by ODC - http://metacpan.org/release/ODC/Mango-1.15 (depends on Mojolicious)
18:48 mst the fact that it already supports that and most of the other things I find myself wanting is why I'm so fond of Future
18:49 mst maybe we need to convince somebody to write MojoIOLoop::Future to go with the POE, IO::Async, and AnyEvent versions
18:50 * Grinnz_ needs to find something to really try IO::Async and futures with
18:50 Grinnz_ though i got a good understanding of notifiers while making Mojo::Reactor::IOAsync
18:51 Grinnz_ future is a little out of that scope i think
18:51 mst uhhh ... IO::Async is basically built on futures at this point
18:51 Grinnz_ well i mean, i didnt use any directly
18:53 mst right, cos the reactor is low enough level it can't really use the abstraction
18:53 Grinnz_ odc: your new github repository link... doesn't work
18:54 Grinnz_ oh, it's probably still using the old one
18:54 Grinnz_ nope, thats whats specified in the meta
18:54 odc crap
18:54 Grinnz_ haha
18:54 mst release management is hard
18:55 Grinnz_ bugs come in many forms
18:55 Grinnz_ i'd report it on the issue tracker... but....
18:56 odc mst, can i upload 2 time the same release?
18:56 mst no
18:56 mst you're going to have to do 1.16 now
18:56 odc of course...
18:56 jberger Grinnz_: isn't the "pass" method what you are looking for?
18:57 mst odc: if you look at my dists, you'll find almost all of them have at least one version whose only changelog entry is "this is an 'mst fucked up the release' release" or so
18:57 Grinnz_ jberger: oh, i guess i could use that too but that's extra args... not the most elegant method
18:57 jberger odc: happens to the best of us
18:57 jberger Grinnz_: what are you trying to acheive?
18:57 Grinnz_ jberger: have metadata accompanying each result
18:57 odc t-thanks
18:58 jberger Grinnz_: $delay->pass(my $metadata = {});
18:59 jberger then use $metadata->{something} = 'blah' to your heart's content
18:59 jberger pass-by-reference
18:59 Grinnz_ jberger: this metadata is per request
19:00 Grinnz_ so to do it with pass, i'd just need to shift off 2 args insteadof one for each result
19:00 Grinnz_ its doable, but like i said, not as elegant
19:03 jberger most non-blocking functions return $err, @stuff anyway, so that's already something that is done commonly
19:03 jberger yeah, it gets a little gangly, but yah know
19:05 sri mst: does Future still leak by default?
19:05 sri promises/futures are awesome until you have to use them
19:06 mst sri: not for years
19:06 sri i remember talking with LeoNerd about it last year, and he said IO::Async depends on it
19:07 mst then I've no idea what you're talking about, since long running IO::Async programs don't generally leak unless you fuck it up
19:08 sri i'm talking about passing objects to the fulfilled/rejected callbacks
19:10 sri for the record, stevans Promises does support Mojo::IOLoop
19:10 sri https://github.com/stevan/promises-perl/pull/32
19:10 sri i tried to make it not leak with inside-out storage of the callbacks
19:11 sri here's an example https://gist.github.com/kraih/11276761
19:11 sri i'd like to see a version based on Future
19:11 sri i do like the promises/a+ design of Promises though
19:13 sri the example is the most common case of async flow control, two sequential non-blocking requests
19:13 cpan_mojo Mango 1.16 by ODC - http://metacpan.org/release/ODC/Mango-1.16 (depends on Mojolicious)
19:13 odc *sigh*
19:14 Grinnz_ it works now :)
19:17 sri mst: btw. i find LeoNerds IO::Async design very inconsistent, with promises and plain old callbacks, instead of promises and observables
19:18 sri that's one of the areas where i find perl6 very interesting, with its Supplies
19:18 * Grinnz_ would offer to write the future glue if he had any experience in the matter
19:18 sri Grinnz_: it's not hard, the gist contains everything https://gist.github.com/kraih/11276761
19:19 Grinnz_ maybe ill play with it some weekend
19:19 sri this is promises/a+ btw. https://promisesaplus.com/
19:20 sri w3c has adopted that spec
19:23 sri it's funny how the promises topic keeps coming up every few months :)
19:27 jberger all in all futures/promises are probably easier to understand
19:27 jberger but I do like delay, now that I grok it, it is really easy to get everything done that I need
19:27 jberger Supplies do look really nice though
19:28 Grinnz_ it seems like just a fancy way of doing the context stuff i've always been doing in POE and such, but since i was earlier asking for a fancy way to do stuff, its fair enough :P
19:28 sri i don't know, we just shouldn't look at delays as some kind of special concept
19:28 sri it's in the category flow control libraries
19:29 sri like async.js
19:29 sri or step.js
19:30 Grinnz_ so if i'm understanding this fieldhash thing correctly, essentially it's storing data in the class keyed by an object identifier?
19:30 sri yes
19:31 Grinnz_ i'd heard of inside out classes but never looked into it
19:31 Grinnz_ inside out objects, whatever
19:31 sri inside-out objects use the same
19:32 sri i've been joking about damian conway beingway ahead with praising inside-out objects in PBP, because we have yet to discover how great they are for async stuff :)
19:32 Grinnz_ it does provide for a separation of contents and methods, i guess
19:33 pink_mist Moose specifically doesn't do it though; I believe they had reasons
19:33 sri same goes for p5-mop actually, it's also inside-out
19:34 sri can't access attributes from SUPER classes without accessors
19:34 jberger sri: yes, it's just flow control, but as you have said, the api is different with futures, it looks a little more imperative
19:34 jberger returning a future object
19:36 sri hahaha, Atom now uses io.js
19:37 * sri feels so hipster
19:38 hahainternet 19:18.07 <@sri> that's one of the areas where i find perl6 very interesting, with its Supplies
19:38 hahainternet i really want to play with this too
19:39 hahainternet but unfortunately my only problems require some improvements in p6's ffi type arrangement
19:39 hahainternet and that requires improvements in nqp
19:39 hahainternet and so again it's something that's on the horizon but just out of reach :(
19:39 hahainternet computers suck
19:53 odin22 joined #mojo
19:54 sri jberger: re learning... plain callbacks win there of course
19:57 sri i think all of these make pretty decent teaching examples actually http://mojolicio.us/perldoc/Mojolicious/Guides/Tutorial#User-agent
19:58 jberger vs futures or vs delays?
19:59 jberger its hard for me to consider ease of learning at this point I guess
19:59 jberger its hard to ungrok sometime
19:59 jberger something
19:59 irq joined #mojo
20:00 Grinnz_ i think the biggest hurdle for delays was understanding the sequence of events from $delay->begin to the next step... i hope the begin() docs are more helpful now
20:00 Grinnz_ for me understanding delays*
20:01 jberger you know, it wouldn't be so hard to bolt-on some kind of register by name for events
20:02 jberger and I mean this explicitly outside of mojo core
20:02 Grinnz_ POE::Loop::Mojo_IOLoop :P
20:03 Grinnz_ i know thats not really what you meant
20:04 Grinnz_ i wish it was as simple to benchmark POE loops as mojo reactors :P
20:05 Grinnz_ i tried some POE benchmark thing but it didnt really tell me anything useful, and it didnt support custom loops (or any added in the past several years)
20:06 reneeb odc: should I add Mango to mojo.perl-services.de?
20:11 odc reneeb, i didn't know about this site! looks useful
20:11 odc yes, i think Mango has its place there
20:12 disputin joined #mojo
20:19 reneeb ok, should be added with the next run (tomorrow)
20:21 jberger Grinnz_: http://pastie.org/9884403
20:23 Grinnz_ jberger: ahhh now i see what you meant
20:23 Grinnz_ i think "register" is a bit too strong a term, that threw me off lol
20:24 sri $reg->gather('mojolicio.us')
20:24 jberger you can think of Delay as the low level handler
20:24 Grinnz_ jberger: it would be better as something you can pass arbitrary keys to though
20:24 Grinnz_ (for the case i was talking about)
20:24 jberger build whatever architecture off of it that you need
20:25 sri if we ever rename ->begin it's going to become ->gather :)
20:25 jberger that's the first name I haven't hated
20:25 Grinnz_ i don't dislike that
20:25 Grinnz_ ;)
20:25 sri haha
20:25 sri to the deprecation mobile!
20:26 jberger I do hate to lose all the published training materials though
20:26 jberger what do we call $end then?
20:26 Grinnz_ i think it is worth it, begin is too confusing a method name
20:26 odc thanks @ reneeb
20:26 mst sri: right, the lack of observables is sucky
20:26 good_news_everyon joined #mojo
20:26 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/b34S
20:26 good_news_everyon mojo/master abe22c2 Sebastian Riedel: use the same User-Agent value consistently
20:26 good_news_everyon left #mojo
20:26 Grinnz_ what $end?
20:27 sri my $cb = $delay->gather;
20:27 jberger $end is what ->begin returns, the callback
20:27 jberger sri: perhaps that is best
20:27 Grinnz_ i've never heard it referred to as an end
20:27 sri it's generic then
20:27 sri there used to be an ->end
20:28 sri it was used like a condvar
20:28 sri delays have evolved *a lot* over the years
20:28 Grinnz_ the method is often passed directly to non-blocking code, which makes the begin/end distinction just confusing at this point
20:28 jberger my URLQueue still uses it like a condvar
20:28 sri we have examples for condvar use too
20:29 sri it's a valid use case
20:29 jberger which is why I wanted to know what to call it :-)
20:29 sri the condvar case would look a bit odd
20:30 sri or maybe not
20:30 sri hmm
20:31 jberger Grinnz_: http://pastie.org/9884403#18
20:31 sri https://gist.github.com/anonymous/0349879c0fea80bce380
20:32 jberger begin feels better for timers in my mind
20:32 sri it does
20:33 Grinnz_ it's not beginning the timer though, that's just misleading
20:33 sri it's beginning a delay
20:33 jberger Grinnz_: gather doesn't convey the fact that it increments the counter
20:34 jberger I'm -1 on a rename of begin, probably forever
20:35 jberger we have debated it ad-nauseum and we always come back to this
20:35 sri ->gather is only fun when you're actually waiting for a value
20:35 jberger literally hours we have talked about this
20:35 Grinnz_ thats true
20:35 Grinnz_ it doesnt make begin any more relevant though :P
20:35 sri green bikeshed
20:36 jberger and rename means changing all the published examples etc, which I'm fine with, when we get the right name
20:36 jberger BLUE
20:36 Grinnz_ i agree, its a big change
20:36 sri step.js calls it this.parallel()
20:36 sri $delay->parallel
20:36 Grinnz_ ehh
20:36 jberger not true of course
20:36 jberger it is in concept
20:37 jberger but not in actuality
20:37 odc $delay->async ?
20:37 Grinnz_ that terms a little too overloaded
20:38 marty joined #mojo
20:39 jnbek joined #mojo
20:41 sivoais joined #mojo
20:51 sivoais joined #mojo
20:52 jnbek joined #mojo
20:58 sri a little
21:00 kaare joined #mojo
21:01 bobkare joined #mojo
21:05 jberger why not zoidberg?
21:05 purl (V) (;,,;) (V)
21:09 rem_lex joined #mojo
21:13 bobkare joined #mojo
21:19 janus joined #mojo
21:22 bobkare joined #mojo
21:27 mst sri: I suspect https://gist.github.com/kraih/11276761 is only a cycle because $ua is a lexical and perl's lexical capture stuff is stupid
21:27 mst sri: try doing { my $ua = ... sub fetch_it { ... } }
21:27 mst sri: I bet the cycle goes away
21:27 mst (I have to go now though)
21:45 dparry joined #mojo
21:47 dparry so I have a case where I'd like to connect to a websocket and then enter effectively an infinite loop which occassionally writes to the websocket. Problem is, this means I never get round to entering the IOLoop and so the websocket request does not happen. Does that make sense to anyone? any tips please? :)
21:49 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Timers
21:50 dparry so I should use a recurring timer?
21:50 Grinnz_ use the IOLoop to do your polling
21:51 dparry I tried doing a $tx->finish() and having the IPLoop send me back round but there seemed to be a significant delay between starting loops
21:52 dparry and I didn't really want to finish and reconnect to the websocket either...
21:53 Grinnz_ unless you have some code to follow i'm not sure i can help
21:54 dparry I will have a bash with the Mojo::IOLoop->recurring and paste some code if I get even more stumped :) thanks
21:59 dparry doing my $id = Mojo::IOLoop->recurring(1 => sub {$self->my_function($arg1, $arg2)}); has seemed to work nicely, thanks!
22:00 Grinnz_ you can do a recurring with a 0 timeout, fyi
22:01 jberger Grinnz_: what would you want to do each tick?
22:01 jberger which is what that would be
22:01 Grinnz_ jberger: well, if he was doing a while loop with no timeout, that would be essentially the same
22:02 jberger dparry: what are you watching?
22:04 dparry each tick I listen for an incoming connection with while ( my @ready = $self->{'Select'}->can_read(1) )
22:04 dparry I receive some data and process it and then every so often post a result to a websocket
22:04 Grinnz_ sounds like you should use a reactor method instead to watch it
22:05 sri http://mojolicio.us/perldoc/Mojo/IOLoop#reactor
22:05 Grinnz_ https://metacpan.org/pod/Mojo::Reactor#io
22:05 dparry basically I want to get back in to that above while loop as quickly as I can
22:05 Grinnz_ dparry: event loops are made for this kind of thing ;)
22:06 dparry so currently I am writing the data to disk, but I find it to be faster to write to a websocket in another process
22:06 dparry that then deals with the writing to disk elsewhere.
22:06 jberger dparry: that sounds like a worker process with a pipe
22:07 dparry basically I fork the app at startup. There are 3 forks in addition to the main mojo app
22:07 good_news_everyon joined #mojo
22:07 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/bsqY
22:07 good_news_everyon mojo/master 175e629 Sebastian Riedel: also mention how to remove a handle again
22:07 good_news_everyon left #mojo
22:07 dparry so it's inter process communication yeah
22:08 Grinnz_ dparry: what sri linked is a good example of using the reactor for the watching
22:08 Grinnz_ you'd use Mojo::IOLoop->singleton->reactor->...
22:09 dparry the recurring IOLoop seemed to work other than needing to figure out how to exit from within the recurring loop
22:09 Grinnz_ dparry: trust me... this does all the work for you
22:09 dparry ok, just have to figure out how it works :)
22:09 Grinnz_ no recurring timer needed
22:09 Grinnz_ it will call the callback only when it becomes readable
22:11 dparry I'm not sure what readable means in the context of my function...
22:11 Grinnz_ $self->{'Select'}->can_read(1)
22:11 Grinnz_ that means it's readable
22:11 asarch joined #mojo
22:12 Grinnz_ but instead of waiting for it, the reactor will just tell you when it happens
22:13 sri http://mojolicio.us/perldoc/Mojolicious/Guides/FAQ#What-is-an-event-loop
22:13 dparry oh I see, this is scrapping the loop and rewriting the function within the loop. interesting...
22:13 Grinnz_ yep. let the event loop do the looping ;)
22:15 * Grinnz_ has gotten far too familiar with the mechanics of event loops lately
22:16 dparry I think the issue though is that readable is pretty much always true in my case
22:16 Grinnz_ then there is always something to do, that's not an issue
22:29 espen joined #mojo
22:44 dparry how do I pass the @ready part of the handle into the reactor, so that I can iterate through it?
22:44 dparry Mojo::IOLoop->singleton->reactor->io(my @ready = $self->{'Select'}->can_read(1) => sub {... doesn't seem to let me reference it...
22:45 Grinnz_ you pass a handle to io, not that code...
22:46 dparry oh
22:56 dparry any good examples of this to look at as I'm not getting it...
22:58 dparry best I found so far was https://groups.google.com/forum/#!topic/mojolicious/yBhxc08oLn0
22:59 Averna joined #mojo
23:15 jnbek joined #mojo
23:15 dparry ok, so think I have the reactor working, other than still needing to figure out how to exit out nicely, thanks for your help
23:17 pink_mist now provide a nice example that you'd have liked to have seen yourself :P
23:23 dparry true true pink_mist I hope to publish the project to cpan before too long then I would have a link :)
23:25 dparry what's the best way of busting out of an IOLoop from within the function that the Mojo::IOLoop->singleton->reactor->io invokes?
23:25 Grinnz_ dparry: do you want to stop the whole ioloop, or just the function?
23:25 Grinnz_ or just the watcher?
23:26 dparry the whole ioloop
23:26 Grinnz_ Mojo::IOLoop->stop
23:27 Grinnz_ it won't break out of the function (you can return yourself if you want to)
23:52 marty joined #mojo

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