Processing a job in background with Haskell Servant -


i'm building facebook messenger chatbot can process long running jobs (that may fail), , need respond 200 facebook before job completed.

i've tried using pipes, after while realized didn't know doing.

how can achieve this?

thanks in advance

edit: epsilonhalbe pointed, question broad. try make more clear.

right have this:

myhandler :: message -> handler text myhandler msg =     dosomestuff msg     return "ok" 

the problem "dosomestuff" long proccess , can give timeout error. want achieve respond "ok" before process completed. http code 202 accepted.

i thinking sending message mailbox solution. more idiomatic way doing it.

i use hworker @ work -- sending batch emails. make instances of job, tojson, , fromjson long-running job, use queue whenever want start job. you'll need redis keep track of state of jobs use hworker.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -