> > When retrieving the starting point data from a back end it sometimes > includes references to other objects. > We keep most of the response data around in the "data" attribute of the > delay and start harvesting the referenced data, which we need to have > around before continuing to the original second step. > For this we prepend new steps like this: > > $delay->steps( @new, @{$delay->remaining} ); > > The final step can be quite generic, taking everything it needs out of the > $delay->data, processing it as required and passing it back to the main > application. >
If you want to keep doing that you're welcome to fork the old Mojo::IOLoop::Delay and release it to CPAN with a new name. Although i believe anything that can't be solved with ->begin/pass/steps should be done with promises in the future. Our implementation is very similar to JavaScript promises, so there is a lot of examples on the internet already that can be adapted with little effort. When implementing M:I:Delay::data and M:I:Delay::remaining something like > this must have been the intended use case. > Honestly, i don't really remember why exactly ->data and ->remaining were added. They were a rather shortsighted workaround for limitations of the overall design pattern and i don't remember ever using them myself. -- sebastian -- 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 mojolicious+unsubscr...@googlegroups.com. To post to this group, send email to mojolicious@googlegroups.com. Visit this group at https://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.