michaelkrone/request-context

Does not work when used in a node cluster

Closed this issue · 1 comments

If I don't use the node cluster (worker processes) I can set userId in the request context and retrieve it from other parts of the code but if I introduce the cluster, the get call returns "undefined".

Hello @strong-hash,
every Node.js application has its own domain handling, so you might fork running instances, but if you would like to share the request accross different applications (e.g.clustered Node.js applications) you need to back the context with a redis store or communicate with the master process or something similar.
This module is simply for providing a context which stays consistent during a request inside a Node application.