Hi Steve
It's as simple as:
post '/blorgle' => sub { debug('Entering delayed handler'); delayed { my %params = params; flush; content '<html><body>ok</body></html>'; done; debug('Sent response'); # Do your async job here }; };
See Dancer2::Core::Response::Delayed, https://metacpan.org/pod/distribution/Dancer2/lib/Dancer2/Manual.pod#Delayed-responses-(Async/Streaming)
Hope this helps!
In reply to Re: Dancer2: respond to client while making its own async call
by 1nickt
in thread Dancer2: respond to client while making its own async call
by stevieb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |