2014-06-28 19:12 GMT+01:00 sri <[email protected]>: > my $end = $delay->begin; >> > > The first argument gets ignored by default. > > my $end = $delay->begin(0); > > >> $mango->db('foo')->collection('bar')->find_one({ ... } => sub { >> my ($coll, $err, $doc) = (@_); >> $end->($doc); >> }); >> > > But i'd rather splice away the arguments i'm interested in anyway. > > $mango->db('foo')->collection('bar')->find_one({ ... } => > $delay->begin(2, 1)); > > -- > sebastian >
Thanks a lot for this. I didn't debug it properly when I claimed callback not called for no docs. Also big thanks for these code snippets - helped me also understand the delay construct and shows a better way to use it. Better than I have been using. bogdan -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.
