function setEnvironmentData
Usage in Deno
import { setEnvironmentData } from "node:worker_threads";
setEnvironmentData(key: Serializable,value: Serializable,): void
The worker.setEnvironmentData()
API sets the content ofworker.getEnvironmentData()
in the current thread and all new Worker
instances spawned from the current context.
key: Serializable
Any arbitrary, cloneable JavaScript value that can be used as a {Map} key.
value: Serializable
Any arbitrary, cloneable JavaScript value that will be cloned and passed automatically to all new Worker
instances. If value
is passed as undefined
, any previously set value
for the key
will be deleted.
void