I'm building a Facebook Messenger chatbot that can process long running jobs (that may fail), and I need to respond 200 to Facebook before the job is completed.
I've tried using Pipes, but after a while I realized that I didn't know what I was doing.
How can I achieve this?
Thanks in advance
EDIT: As epsilonhalbe pointed, the question is very broad. I would try to make it more clear.
Right now I have this:
myHandler :: Message -> Handler Text
myHandler msg = do
doSomeStuff msg
return "ok"
The problem is that "doSomeStuff" is a long proccess and it can give a timeout error. So what I want to achieve is to respond "ok" before the process is completed. The Http code is 202 Accepted.
I was thinking that sending a message to a mailbox could be a solution. But I would like a more idiomatic way to doing it.