0

I have a question how do i "sync" data, for example userdata in cache for all workers / cluster in a node js Cluster Thread?

Like a static variable but for all threads.

for example a static string[] is the "same" in worker thread 1 and 2

the array is getting edited in the cluster thread so its not so usefull if the main thread is giving them it over.

4
  • 1
    Can you use the file system or a database? Commented Oct 19, 2022 at 17:34
  • look at this worker.workerData maybe it can help you. Commented Oct 19, 2022 at 17:45
  • @HeikoTheißen of course but if i want to make a cache that is a cache for example. Commented Oct 20, 2022 at 5:36
  • @AbdurrahimAhmadov the link is wrong but i looked it up, it is "good" but its only possible during creation, so its almost useless. Commented Oct 20, 2022 at 5:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.