Guest User

Untitled

a guest
Jul 17th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. # Using shared-structs with Workers <3
  2.  
  3. This showcases how you can use shared-structs
  4. over an SharedArrayBuffer, to share complex data structures
  5. between worker_threads in Node.js
  6.  
  7. The main.js example starts a worker and passes a shared struct to it.
  8.  
  9. The worker will periodically update the struct with an incrementing tick and a random number
  10.  
  11. After 2s it will read the source code of itself into the worker as well.
Add Comment
Please, Sign In to add comment