Skip to content

Instantly share code, notes, and snippets.

@epixa
Created January 11, 2016 22:50
Show Gist options
  • Save epixa/8abbe6af1418022312e2 to your computer and use it in GitHub Desktop.
Save epixa/8abbe6af1418022312e2 to your computer and use it in GitHub Desktop.
#shutdown()
removes the message listener from the fork
#parseIncomingMessage()
ignores non-arrays
invokes onMessage for given msg
#onMessage()
when type is WORKER_BROADCAST
emits broadcast event with data
when type is WORKER_LISTENING
flags worker as listening
emits listening event
#onDisconnect()
flags worker as not listening
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment