New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use Worker with typescript processor file? #1274
Comments
You may have some luck using ts-node to run your workers. I am afraid, typescript+node+esm6 is basically broken in 2022. When the dust settles this situation may improve, but currently, it is really painful and I do not have any magical solutions to make this work in a satisfactory manner. I will write a blog post if I can find some workaround or some way to make this work as painless as possible. |
Have you considered using native nodejs |
I was able to use typescript processors thanks to an example I saw in the original Bull library. You just need to switch from ts-node-dev to nodemon + ts-node. @mrbrianevans thats an interesting suggestion. My goal is to concurrently process multiple jobs without blocking the main event loop that handles API requests and file upload, thats why I was wondering...
|
I wrote a blog post that hopefully clarifies a few things: https://blog.taskforce.sh/using-typescript-with-bullmq/ |
Let me know if I need to complete the post with more information. |
Thats exactly what I was looking for, thank you! |
@manast Thanks for the blog post, I've been having issues with nodemon and child_processes that hang, doesn't seem to happen with tsc-watch. |
You could also try using worker threads instead: https://api.docs.bullmq.io/interfaces/WorkerOptions.html#useWorkerThreads |
Hello everyone! I was wondering, is it possible to use sandboxed jobs with typescript processor file?
I know its possible to use worker_threads with typescript by using
require("ts-node").register()
.Any ideas how to make it possible?
The text was updated successfully, but these errors were encountered: