-
In an asynchronous task processing queue, a job needs to request the interface of another service, wait for feedback on the completion of another interface call task, and update the task status.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
In javascript you cannot do that, when you have an async function it must complete or fail (or run forever if it does not timeout or something). If you control the service "algorithm/process" what you typically do is that you post some job there, and then return immediately, when the algorithm/process completes it posts the result in another queue, a result queue, that some other service listens to, and so on. Maybe this blog post can give you some ideas: https://blog.taskforce.sh/do-not-wait-for-your-jobs-to-complete/ |
Beta Was this translation helpful? Give feedback.
In javascript you cannot do that, when you have an async function it must complete or fail (or run forever if it does not timeout or something). If you control the service "algorithm/process" what you typically do is that you post some job there, and then return immediately, when the algorithm/process completes it posts the result in another queue, a result queue, that some other service listens to, and so on. Maybe this blog post can give you some ideas: https://blog.taskforce.sh/do-not-wait-for-your-jobs-to-complete/