Skip to content

Conversation

@richardbowman
Copy link

I doubt my change is perfect yet, and lacks tests, but wanted to initiate a conversation on whether or not the ability to customize the code running in the master process could fit into the core features of naught. A very simple use case is to manage log file writing, but any place where you may want some shared state between workers this could help. Log4Js for instance has an example for clustered mode:

https://github.com/nomiddlename/log4js-node/wiki/Multiprocess

But you obviously need to support adding some code into the master process. I've done this by allow a master process script file to be passed to naught, and then requiring it in. It can export a "online" function to be notified when new workers start. Probably needs a more developed contract/API, so open to ideas on changes. It has been working well for us to support master process file logging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant