On Fri, May 5, 2017 at 10:12 AM, Dan Book <gri...@gmail.com> wrote:

> It cannot return to the same method, if that's what you're asking. Any
> action you wish to take using the results must be within that callback, or
> called by that callback; so perhaps pass a callback to your model for it to
> call from its callback, if that makes sense. https://metacpan.org/po
> d/Mojolicious::Plugin::DefaultHelpers#delay can help with this in the
> controller method.
>

Dan, thanks so much for your reply and advice!  Using your advice, I came
up with something that appears to work.  Can you look at it and see if it's
what you had in mind and confirm that this is a good method for me to move
forward with performing non-blocking calls in a Model, similar to Mojo::Pg
Blog?

https://gist.github.com/s1037989/53f5c0f1d0107bf5e3919519971fd79a

In the delay() call in my Model, note that I'm using get() from ua pointed
to deelay.me to simulate a time-consuming database query.  deelay.me just
waits the requested number of milliseconds before redirecting the get
request to the requested URL.

-- 
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.

Reply via email to