Logging/Emitting Events from a worker #127
-
Hi! I'm currently using piscina to run a queue of long-running tasks, and I would like to be able to get logs out from the worker about a task as the task runs. The way I see it, my options are:
The second option is a preferable, largely because my workers have a dependency on a C++ library that decides it likes to spam stdout while it runs. I'm not entirely sure how I'd go about doing this. Any ideas/suggestions? Is this something piscina supports or will I have to do some other weird hack |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Take a look at the progress example in the examples directory :-) It largely illustrates how to accomplish what you're looking to do. There's not really anything we can do about the C++ writing out to stdio as that is bypassing the Node.js stdio re-routing used for worker threads. |
Beta Was this translation helpful? Give feedback.
Take a look at the progress example in the examples directory :-) It largely illustrates how to accomplish what you're looking to do.
There's not really anything we can do about the C++ writing out to stdio as that is bypassing the Node.js stdio re-routing used for worker threads.