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

IRC log for #mojo, 2014-02-21

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

All times shown according to UTC.

Time Nick Message
00:13 marty joined #mojo
00:15 Stefan joined #mojo
00:16 bpmedley http://pastie.org/8753672 <-- Here is the patch that would allow "Mojo::IOLoop->timer($i => $end->($i));" to work.  I'm just throwing this out there to see what people think.
00:20 jack joined #mojo
00:26 dvinciguerra joined #mojo
00:30 bpmedley http://pastie.org/8753695 <-- Would a convience method "step" be a good addition?  It could call begin and return the $end variable.  With previous editions, the sub construct would not be needed, I don't think.
00:34 jberger_ joined #mojo
00:35 jberger_ As sri has said previously, delay and steps is already very hard to explain and hard to understand for new comers
00:35 Stefan joined #mojo
00:36 jberger_ For as interesting as that is, it adds complexity and makes it harder to see that there is a callback there
00:36 bpmedley Understood; would the "step" addition make things simpler?
00:37 jberger_ That is better, but again I think we are solving a problem that doesn't exist
00:37 jberger_ And doing so by adding complexity, where arguably complexity is actually the biggest problem
00:38 jberger_ It's why I gave up on my patch yesterday
00:39 btyler jberger: I just experienced the joy and wonder of Tie::Array::CSV -- it was awesome, thanks putting it out there.
00:39 btyler *thanks for
00:40 bpmedley Hrmm.  I do see your point that complexity is an issue - what type of construct would seem simpler?
00:49 zM joined #mojo
00:52 laouji joined #mojo
00:53 bpmedley Mojo::IOLoop->timer($i => $delay->step($i));  <-- This could be supported; the documentation might read: "Convience routine that increments the active event counter and returns a callback to decrement the active event counter.  Is meant to advance to the next step in a straightforward fashion."
01:07 sri bpmedley: looks to me like you're inventing problems
01:08 d4rkie joined #mojo
01:08 bpmedley I see.  Not trying to.. I'm just new.. :)   At least, that's my excuse right now.
01:09 bpmedley What would a simpler API look like?
01:09 sri bpmedley: i mean you're making solutions in the search of a problem
01:11 bpmedley The problem I'm trying to address is the complexity, which I appear to be failing at.
01:12 sri i very much doubt you can remove complexity by adding functionality
01:13 bpmedley Hrmm, that's a good point.
01:26 sri if we decide to revisit the sharing of data between steps issue ever again... i think what it all comes down to is a stash... $delay->stash(foo => 'bar')->steps(sub { ...$delay->stash('foo')... }, ...)
01:27 sri that's the root issue here
01:27 asarch joined #mojo
01:28 sri (->stash is only a placeholder... call it ->scope or whatever)
01:29 Stefan joined #mojo
01:35 bzero joined #mojo
01:55 Stefan joined #mojo
01:57 jberger_ btyler glad you like it
01:57 jberger_ That's still one of my favorites
02:05 grit joined #mojo
02:09 s1037989 joined #mojo
02:10 klapperl_ joined #mojo
02:12 rem_lex joined #mojo
02:19 bzero joined #mojo
02:29 grit joined #mojo
02:38 bzero joined #mojo
02:43 daniel_ joined #mojo
02:44 daniel_ left #mojo
02:44 jberger_ At $work today I fell into the python variable scoping hell
02:45 jberger_ God how I miss having lexical variables in loops
02:46 jberger_ <3 perl
02:58 jnbek aye
02:58 jnbek they're forcing me to concede and learn Py at work
02:58 jnbek stupid Openstack
02:58 jnbek I'll find some way to make it smell like Perl though
02:58 jnbek :D
03:07 jb360 joined #mojo
03:17 s1037989 joined #mojo
03:40 webart joined #mojo
03:48 d4rkie joined #mojo
03:59 grit joined #mojo
04:11 grit joined #mojo
04:32 laouji joined #mojo
04:41 grit joined #mojo
04:56 * sri ponders adding Mango::Collection::wait_for, which does the same as find_one, but retries every n seconds until a result is found
04:57 sri $db->collection('results')->wait_for(0.5 => {job => $id} => sub {...});
05:00 sri push notifications with capped collections and tailable cursors are nicer, but require much more work to set up when you're just prototyping stuff
05:50 D4RK-PH0ENiX joined #mojo
06:26 jamesw joined #mojo
06:29 sujithm joined #mojo
06:42 sujithm joined #mojo
06:52 dod joined #mojo
06:57 gnephiak joined #mojo
06:57 Vandal joined #mojo
07:06 tempire Better openstack/python than cloudstack/java
07:06 tempire count your blessings.
07:06 tempire doesn't hate the wait_for idea.
07:07 tempire stash is an interesting idea for steps.
07:07 tempire Speaking of that, I'd really like a way to modify steps on the fly
07:07 tempire append_step, splice_step
07:08 tempire not sure splice is the right direction
07:08 tempire but being able to modify logic pathways is a definite need.
07:10 tempire as in, I want to execute the next step if 1, but the next next step if 2
07:10 dod joined #mojo
07:11 tempire you can do it currently with passing parameters, and "return $delay->begin(0)->() if $param == 2", or something along those lines.
07:11 tempire but it doesn't feel good.
07:12 tempire I wonder if stash is really needed, since you can just use scoped variables.
07:12 tempire from the same scope that $delay is instantiated in.
07:13 tempire Oh, but maybe not if the steps exist in another place.
07:13 * tempire considers stash
07:26 basiliscos joined #mojo
07:37 maxhq joined #mojo
07:49 dod joined #mojo
07:58 priodev_ joined #mojo
08:05 marty joined #mojo
08:05 eseyman joined #mojo
08:12 laouji joined #mojo
08:13 sujithm joined #mojo
08:17 klapperl joined #mojo
08:18 eseyman joined #mojo
08:26 ver joined #mojo
08:30 rawler joined #mojo
08:37 heinz joined #mojo
08:50 odc joined #mojo
08:57 Andy2 joined #mojo
09:09 bowtie_ joined #mojo
09:11 meshl joined #mojo
09:15 fhelmber_ joined #mojo
09:17 irq joined #mojo
09:24 heinz hello, i have strange problem where i can't seem to store stash and pass it to template. if i use <%= $message %> it throws explicit package name exception.
09:25 heinz if i use session 'message', its empty
09:25 moritz well, if you use <%= $message %>, you need to pass $c->stash(message => ...)
09:26 moritz well, where's the data? is it in the session? or in the stash? or nowhere?
09:27 heinz its in stash, under controller, i define it like this $self->stash(message => "this is message");
09:27 moritz then <%= $message %> should work
09:27 moritz unless you're in an included template, for example
09:28 moritz if it doesn't work, please paste a small example that can reproduce the problem
09:30 heinz let me try first
09:40 heinz yes, thank you moritz, now its works.  i have line before i set the stash to check session 'return $self->session('user') || !$self->redirect_to('/');'
09:40 heinz i'm not sure how is affecting, but after i remove the line its fine
09:43 jwang joined #mojo
09:43 grit joined #mojo
09:45 trone joined #mojo
09:53 da5id joined #mojo
09:55 laouji joined #mojo
09:58 hrupp joined #mojo
10:00 punter joined #mojo
10:05 sujithm_ joined #mojo
10:14 Jonneh joined #mojo
10:18 sujithm joined #mojo
10:34 sujithm joined #mojo
10:36 sujithm_ joined #mojo
10:51 gnephiak joined #mojo
11:16 marty_ joined #mojo
11:29 kanishka joined #mojo
11:33 kanishka is there any method to archive user log ?
12:02 Andy2 I am trying to render an image like this: $self->render(data => $data, format => 'png'); Can anyone please tell me what type of data $data has to be?
12:07 mire_ joined #mojo
12:16 bpmedley kanishka: You can use logrotate.
12:18 bpmedley Andy2: http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Rendering_data  <-- Docs say no encoding will be performed.
12:18 Andy2 i saw that but i don't understand it :)
12:19 Andy2 How exactly to i opne the file to pass it to render?
12:19 bpmedley One sec
12:19 Andy2 i tried it with open <FILE> and binmode
12:19 Andy2 and MOJO::Asset::Fiel as well
12:20 Andy2 but i'm not even sure that ok in a Mojolicious app
12:20 fhelmber_ joined #mojo
12:21 bpmedley Andy2: my $data = Mojo::Util::slurp($file);
12:22 Andy2 AWESOME
12:22 Andy2 works :)
12:22 bpmedley Also, https://metacpan.org/release/Mojolicious-Plugin-RenderFile might be helpful.
12:22 Andy2 Man that was hard to figure out
12:22 fhelmber_ joined #mojo
12:23 Andy2 Thanks a lot bpmedley
12:23 bpmedley You are welcome.  I wonder why the binmode didn't work.
12:23 Andy2 May i ask where and how you found that info?
12:24 bpmedley Hrmm.  I would think your binmode and open code should work, so maybe we should backtrack and figure that one out?
12:25 bpmedley However, to answer your question, I can't pinpoint it exactly - just that I knew "slurp" returned bytes and render(data => $data) expected bytes.
12:26 Andy2 hehe ok
12:26 fhelmber_ joined #mojo
12:30 bpmedley Andy2: http://pastie.org/8755302 <-- Also works; however, slurp is more succinct.
12:30 Andy2 ok cool, i just did it wrong i guess
12:31 Andy2 btw, do you have any idea how to pass a filename to a route?
12:31 bpmedley A filehandle or a filename?
12:31 Andy2 "/:name" cuts everything after the .
12:31 Andy2 i mean from teh browser as a parameter
12:32 bpmedley http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#Relaxed_placeholders
12:32 Andy2 i want to have link urls like "images/test.png" so i have to hass the whole filename included the file extension
12:33 bpmedley Said another way, try changing the ":' to a "#".
12:33 Andy2 ah right
12:33 Andy2 thanks again
12:34 bpmedley You are welcome.  There's a lot to figure out in the beginning - it's worth it, though.
12:35 jack joined #mojo
12:36 skullbocks joined #mojo
12:38 Andy2 Yep but its really fun
12:39 Andy2 you can achieve a working prototy realy quick
12:39 bpmedley Yes, Mojolicious is amazing.
12:43 Andy2 The hardest part for me as a one week beginner is to know the difference between Mojo, Mojolicius, Moajolicious::Lite and when tu use what or how to mix it
12:50 nic joined #mojo
12:51 fhelmber_ joined #mojo
12:52 batman Andy2: Mojolicious inherit from Mojo
12:52 Andy2 yep i know that much :)
12:52 batman Mojolicious::Lite doesn't do anything, except exporting functions (sugar) to the caller namespace
12:53 Andy2 is there a place where that is explained a bit?
12:53 batman https://metacpan.org/source/SRI/Mojolicious-4.83/lib/Mojolicious/Lite.pm # import() is called when you "use Mojolicious::Lite;" which again creates functions in the namespace you did "use ..." from
12:54 batman Andy2: is "import()" a method you're familiar with in perl?
12:55 Andy2 no
12:55 Andy2 i will read about it, no need you explain that to me :)
12:55 Andy2 Thanks
12:55 batman it's a perl thing. nothing you usually need to worry about :)
12:56 Andy2 hehe
12:57 bpmedley Andy2: Mojolicious::Lite is a micro real-time web framework built around Mojolicious.  Mojolicious and Mojolicious::Lite are the sum of many parts, small building blocks that can be used independently.
12:57 batman Andy2: https://metacpan.org/pod/Exporter maybe this could give you an idea...
12:57 bpmedley Does that make sense?
12:57 sujithm joined #mojo
12:58 Andy2 bpmedley: It does
12:58 Andy2 batman: i will have a look
13:01 batman Andy2: when you "use Some::Module" Some::Module->import() will be called, if it exists. this import() method can then do "whatever"
13:01 batman whatever is often modifying the caller namespace (the module/file you did "use ....;" from)
13:02 batman like use Mojo::Util qw( slurp ); will allow you to do slurp($file); instead of Mojo::Util::slurp($file) in the namespace you did "use ..." in
13:03 batman the reason this works is because "Mojo::Util" will export (using the import() method) the slurp() function.
13:03 d4rkie joined #mojo
13:06 skullbocks joined #mojo
13:10 Andy2 ah right, i remember now
13:10 ghandi|work joined #mojo
13:12 Andy2 nice, serving images works now.. now i can put em out of my public folder
13:12 Andy2 and they cannot be hotlinked
13:12 Andy2 (i hope) :)
13:12 bpmedley Andy2: There may be an alternate way to stop hotlinking and keep the images in your public folder.
13:13 Andy2 but i don't want to keep them there
13:13 Andy2 they are just temporary
13:15 bpmedley I see; however, if you use the Mojolicious internals to serve the static files, you will probably getter better scalability and lower memory usage.  The RenderFile plugin is probably also better than the slurp method.
13:20 Andy2 can you elaborate on that?
13:20 Andy2 how would you do it?
13:20 Andy2 an example if you have would be great
13:21 bpmedley Ok, so I'm going to assume that to stop hotlinking you would check the remote address or somesuch before serving the file?
13:22 bpmedley What I'm asking is: what criteria are you using to figure out if the file is hotlinked?
13:23 Andy2 i make the file visible based on a session value
13:23 bpmedley Just a sec.
13:24 d4rkie joined #mojo
13:24 Andy2 so when you have a file and i have one we both see 1.png but the result is different
13:24 Andy2 or non existent at all
13:24 Andy2 based on the value of the cookie/session value
13:26 nic That could be quite funny to abuse
13:27 nic (if the session matches some pattern, deliver all images upsidedown)
13:28 nic hm, one of the guys in the office has his birthday today; could deliver all his images a little blurry :)
13:28 Andy2 i don't understand, teh session is only client side, what do you mean?
13:28 Andy2 hehe
13:28 nic it would rely on identifying/classifying sessions
13:29 Andy2 well ok yes but then the whole Mojolicious client session concept would be  teh problem, right?
13:29 nic here each session contains username, so I'd use that
13:30 Andy2 Isn't the session encrypted?
13:30 nic it's signed
13:30 jberger__ joined #mojo
13:31 nic and if the server can't read it, not much use
13:31 batman Andy2: you can't modify the session on client side, but you sure can read it :)
13:31 Andy2 ok, so is this a real problem? :)
13:31 nic no, I said "funny"
13:31 Andy2 nic: Go to your birthday party ;)
13:32 nic :)
13:37 bpmedley Andy2: http://pastie.org/8755528
13:39 Andy2 ok but should the check for the value be enough?
13:40 Andy2 *shouldn't
13:40 Andy2 btw i don't know hook i have to check that first
13:40 Andy2 maybe it explains something :)
13:40 bpmedley Understood.  Keep in mind that the hook will run before the 1st time the user gets any html.
13:41 bpmedley A bridge may be a better option.
13:44 sh4 joined #mojo
13:47 Andy2 bpmedley: ok, took me a while but now i understand it, great concept
13:48 Andy2 i'm still not sure i need it now but i will keep that in mind
13:56 grit joined #mojo
14:00 asarch joined #mojo
14:37 morzechowski joined #mojo
14:37 morzechowski hey, I'm using https://github.com/jamadam/mojo-legacy
14:38 morzechowski as the code I'm writing has to run on 5.8.*
14:38 morzechowski I started to intgrate my small project with Millzila and Carton
14:41 morzechowski I'm wondering how can I integrate the mojo legacy that I'm using thith those
14:43 jberger_ joined #mojo
14:47 grit joined #mojo
15:02 Jonneh_ joined #mojo
15:03 gryphon joined #mojo
15:06 Dandre joined #mojo
15:10 grit joined #mojo
15:11 batman sri: is there a tool to sort the methods, or do you do that by hand?
15:40 russum1 joined #mojo
15:51 meshl joined #mojo
15:57 btyler joined #mojo
16:15 skullbocks joined #mojo
16:31 marty joined #mojo
16:54 punter joined #mojo
17:01 * sri wonders where to put private methods and functions used in multiple mojolicious classes
17:02 sri like this one, which could be used in at least 3 classes https://github.com/kraih/mojo/blob/master/lib/Mojo.pm#L44
17:04 sri possibly 4 if delays ever get a stash
17:17 batman sri: maybe a bit too hackish, but you could put them into Mojo::Util and import them...
17:17 batman even though they are private
17:17 batman and methods :)
17:18 sri another candidate is https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Routes/Match.pm#L96
17:18 sri which could be shared by 2 classes
17:19 grit joined #mojo
17:28 good_news_everyone joined #mojo
17:28 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/1WLYXA
17:28 good_news_everyone mojo/master ff5997a Sebastian Riedel: mention how to deploy multiple applications together in cookbook
17:28 good_news_everyone left #mojo
17:33 sri dunno about Mojo::Util... sub stash { shift->Mojo::Util::_stash('stash', @_) }
17:33 sri exporting certainly not
17:33 sri but maybe like that
17:34 sri still don't like how far away it is... for a provate method/function
17:34 sri *private
17:35 fhelmber_ joined #mojo
17:37 hummeleBop joined #mojo
17:43 good_news_everyone joined #mojo
17:43 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/dv11_Q
17:43 good_news_everyone mojo/master 47d6eb2 Sebastian Riedel: moved deployment example into a different section of the cookbook
17:43 good_news_everyone left #mojo
17:44 Jonneh joined #mojo
17:47 batman why not export?
17:55 tianon Mojo::_Private ?
17:55 * tianon hides under a rock
17:56 * sri attempts to set the rock on fire
17:59 tianon :D
17:59 schetchik joined #mojo
17:59 tianon http://www.fileformat.info/info/unicode/char/1f525/index.htm
18:00 tianon my terminal doesn't want to render it, but that's some legit FIRE right there: ????
18:03 dod joined #mojo
18:06 sri ????????
18:06 sri it worked \o/
18:06 Adura Good old numberbox.
18:19 bluescreen joined #mojo
18:29 * cfedde needs more fonts
18:35 irq joined #mojo
18:47 batman https://github.com/jhthorsen/mojo-irc/pull/6 # anyone who can give me feedback on the CTCP extension of Mojo::IRC+
18:47 batman ?
18:47 batman marcus: ^^
18:48 marcus batman: looks great. Lean mean code machine.
18:49 marcus fire renders great in convos on osx too.
18:49 marcus Guess batman just sees a []
18:50 tianon marcus: can you take a screenie so we can all share the love? O:)
18:50 marcus tianon: https://www.evernote.com/shard/s22/sh/ff341dae-a739-4817-9f64-53bc3aeebda3/654b988aa42cff89ec714ff1fa71135f/deep/0/Nordaaker----oslo.pm-on-magnet.png
18:51 tianon perty ♥
19:01 tianon marcus: btw, you can switch back to just "ubuntu:13.10" and drop the explicit addition the universe in the convos dockerfile - the updated "ubuntu:13.10" image already has the universe in it :)  ("docker pull ubuntu" if you don't have the updated version already)
19:01 tianon I can PR instead if you'd like :)
19:01 mire_ joined #mojo
19:07 * tianon remembers that PRs are discrete proposals, and goes to work one up
19:07 tianon s/discrete/explicit/g
19:08 batman it's weird that i just see []... i got a plugin that should render it fine :/
19:09 batman thanks marcus
19:11 allison joined #mojo
19:16 marcus tianon: I changed away from 'base' because it said it was discarded. Pull requests would be most welcome.
19:17 * marcus is feeling rather ill today.
19:17 marcus Man cold
19:17 tianon yeah, "base" is ancient and crappy :)
19:17 tianon but stackbrew/ubuntu migrated to "ubuntu" proper :D
19:17 tianon I'm just testing before I PR :)
19:43 marcus good
19:54 cpan_mojo Mojo-IRC 0.05 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojo-IRC-0.05
19:54 batman \o/
19:54 batman stephan48: ^
19:55 marcus batman: guess we can up the convos dependency too then?
19:55 stephan48 thanks :)
19:56 stephan48 remainds me that i forgot to do something
19:56 marcus batman: btw, did you see your pull request fails tests?
20:04 marcus (avatar one)
20:04 klapperl_ joined #mojo
20:05 nic_ joined #mojo
20:08 tempire in around_action, is $next->() effectively the same as $action->($c) ?
20:21 bluescreen joined #mojo
20:27 GabrielVieira joined #mojo
20:30 sri tempire: https://github.com/kraih/mojo/blob/master/lib/Mojolicious.pm#L121
20:31 sri *exactly* the same
20:36 batman marcus: let'd not up the dep yet
20:36 batman I haven't looked at it. Want to change to CTCP AVATAR or something first
20:41 tempire curious.
20:41 * purl gives the small curious key to Bilbo. Thorin sits down and starts singing about gold.
20:44 tempire https://gist.github.com/tempire/9143087
20:45 tempire $self->tx is undefined after the render, but only when the around_action hook exists.
20:45 tempire If the problem is scope, I'm going to shoot someone.
20:45 hummeleBop joined #mojo
20:46 bpmedley tempire: http://mojolicio.us/perldoc/Mojolicious/Controller#tx
20:48 tempire then it should work if a my $tx = $c->tx is at the top of around-action
20:48 tempire and yet
20:49 bpmedley Sorry, what line number is that you're talking about?
20:50 tempire refresh. If the issue is a weakened ref to $c->tx, then it would work because of the added line 6.
20:50 tempire but line 41 is still presenting the error because of an undefined $self->tx
20:52 meshl joined #mojo
20:53 bpmedley $self->stash->{_tx} = $self->tx;  <-- works if I add that, dunno exactly why
20:54 tempire oh
20:54 tempire damnit
20:54 tempire it is scope
20:54 tempire ITSALWAYSSCOPE
20:55 hummeleBop joined #mojo
20:57 sri tempire: it's scope
21:06 batman :)
21:12 bpmedley http://liveperl.us <-- Start of a docker based tutorial for Mojolicious.  Would this be useful with an expanded version?  There's only 10 "slots" right now, be kind.. :)  It takes around 15 seconds to the 1st time in a section.
21:15 tempire I dig it.
21:15 tempire The concept, at least.
21:16 bpmedley Thanks.  There are quite a few changes/improvemnts that could be done.
21:16 tempire If you get it working well, I would use it.
21:17 tempire oh, save and then click live
21:17 tempire it does work
21:17 bpmedley Yes
21:17 bpmedley :)
21:17 sri it started very very slow... but once it gets going... this is not as slow as i expected http://liveperl.us:8006/
21:17 bpmedley sri: It creates the doctor image and container on the fly.
21:18 bpmedley *docker
21:18 bpmedley Once that  is done it's faster.
21:18 tempire This is an excellent idea, though.
21:18 tempire I could use something like this for the training course.
21:18 * tempire really needs to look into docker
21:19 bpmedley $self->render(text => $self->dumper(Mojo::Home->new('/')->list_files));  :)
21:20 sri i'm not a smart man... of course the formatting is unreadable
21:20 bpmedley tempire: Do you want the code?
21:20 tempire yes
21:20 bpmedley I'll get it on github soon.
21:20 bpmedley By EOD today, is the goal.
21:23 bpmedley sri: Did you see the playground?
21:23 sri and i even got the quote wrong! http://buttersafe.com/comics/2008-10-23-Detour.jpg
21:25 bpmedley As an aside, the app uses morbo to watch a mounted directory and file, so when Save is pressed morbo reloads.
21:26 sri sure is fun
21:29 btyler bpmedley: awesome! a really cool thing would be to have the 'result' in an iframe, at least while its still simple stuff like hello world or small json blobs
21:30 bpmedley btyler: That would be cool.
21:31 bpmedley I upped the slots to 30.  Will see what happens.. :)
21:45 skullbocks joined #mojo
21:59 beyondcreed joined #mojo
22:06 grit joined #mojo
22:12 bluescreen_ joined #mojo
22:14 basiliscos joined #mojo
22:19 grit joined #mojo
22:28 grit joined #mojo
22:46 Andy2 Is someone willing to answer a hopefully simple javascript jquery question? :)
22:49 skullbocks joined #mojo
22:55 tempire oh
22:55 tempire someone's trying again
22:56 tempire https://github.com/neovim/neovim
23:01 skullbocks joined #mojo
23:06 sri tempire: do you actually have a use case for manipulating steps?
23:07 tempire yes
23:07 sri implementation seems very simple
23:08 sri http://pastie.org/8756934 # basically all you need
23:09 sri then you can do whatever you like with $delay->remaining
23:09 tempire neat
23:19 sri i suppose a stash would go very well with customizable remaining steps :S
23:23 tempire $delay->stash() ?
23:23 sri i'd give it a different name
23:24 sri $delay->scope() maybe, but same semantics
23:25 sri we already have $app->config(), $app->defaults() and $c->stash()
23:25 sri :)
23:26 sri and $dom->attr() is actually not too far off either ;p
23:27 sri https://github.com/xavi-/two-step # this one calls is this.data :D
23:28 tempire $self->data_info
23:28 sri i'm cool with $delay->data() too though
23:29 sri easy to document... "Data shared between all steps."
23:31 sri i get the use case for ->data(), and i think for more reusable steps it makes sense... but i'm not convinced of ->remaining() yet... soooo you better come up with a good use case!
23:41 tempire https://gist.github.com/tempire/9146042
23:45 sri not very pretty
23:46 sri and actually wrong
23:46 sri sub { ->begin(0)->(...) }
23:47 sri and not even a good example
23:47 sri it would be cleaner in one step
23:47 tempire how is it wrong?
23:48 sri you don't increment the active event counter
23:48 sri hmm... this makes me slightly opposed to the whole thing now
23:55 sri http://pastie.org/8757017 # this completely destroys your example
23:55 bpmedley https://github.com/brianmed/liveperl.us  <-- Here is the majority of the code for liveperl.us
23:56 GabrielV_ joined #mojo
23:56 * sri pokes tempire
23:56 mtj joined #mojo
23:57 tempire so lets say that you have 3 more subs attached to your example.
23:58 tempire and there are multiple paths of execution, depending on what each response is
23:58 tempire passing subs in is easier than having many combinations of if else, especially if each API is different.
23:59 sri so completely different code paths where each path doesn't even have the same number of steps?

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