-
Notifications
You must be signed in to change notification settings - Fork 22
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
Propagate events from worker stream #97
Comments
This would be nice to have. Would you like to send a PR? |
Sure, I will submit a PR in the next days/weeks 👍🏻 |
ggrossetie
added a commit
to ggrossetie/thread-stream
that referenced
this issue
Aug 22, 2022
ggrossetie
added a commit
to ggrossetie/thread-stream
that referenced
this issue
Aug 22, 2022
ggrossetie
added a commit
to ggrossetie/thread-stream
that referenced
this issue
Aug 22, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We've introduced a bunch of events on
pino-socket
but as far as I know it's not possible to listen to them as soon as we are using a ThreadStream.Worker thread can communicate with the parent thread using
require('worker_threads').parentPort.on('message')
. I think it would be nice to allow transport to publish events through this port:We will need to add a case in the
onWorkerMessage
function to propagate the event:thread-stream/index.js
Lines 152 to 167 in deaedaa
Something like:
With the above changes it's possible to write:
If we don't want to propagate events but still allow transport to send post message then we should allow the code
EVENT
. In this case, we could write:The text was updated successfully, but these errors were encountered: