> On 22 Oct 2019, at 12:31 am, BobbyBrown <[email protected]> wrote:
>
> I still have not figured out how to reliably get data out of a minion task,
> I'll have to work on events and read up on non-blocking.
> If I understand the code correctly the linkcheck example simply fails if the
> minion job has not finished when it looks up the result?
The minion job is completely independent of your web request - which is the
entire point.
If you are doing something which you expect to be completed in the time of the
request, then you may as well just execute it immediately and block waiting for
it (or look at Mojo::IOLoop::Subprocess).
Otherwise, you would check back on the minion job later, perhaps via a REST
request or similar.
A typical flow:
* request causes minion job to be enqueued
* job id is returned to the user's browser
* user's browser starts polling a REST endpoint looking for job completion (via
javascript)
* once the job is complete, the browser redirects to a new URL with the job data
This is far from the only way to do it, and javascript is not a requirement.
Cheers,
Justin
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/mojolicious/FC37D777-C462-49D8-B64E-F6A4504674B3%40hawkins.id.au.