func importCluster() {.importjs: "import * as worker_threads from \'worker_threads\'@".}
-
Alias for import * as module_name from 'module_name';. Must be called once before using the module
func requireCluster() {.importjs: "const worker_threads = require(\'worker_threads\')@".}
-
Alias for const module_name = require('module_name');. Must be called once before using the module
func newBroadcastChannel(name: auto): BroadcastChannel {.
importjs: "(new BroadcastChannel(#))".}
-
https://nodejs.org/api/worker_threads.html#worker_threads_new_broadcastchannel_name
func newWorker(filename: cstring): Worker {.importjs: "(new Worker(#))".}
-
https://nodejs.org/api/worker_threads.html#worker_threads_new_worker_filename_options
func newWorker(filename: cstring; options: JsObject): Worker {.
importjs: "(new Worker(#, #))".}
-
https://nodejs.org/api/worker_threads.html#worker_threads_new_worker_filename_options
func getEnvironmentData(self: auto): auto {.importjs: "worker_threads.$1(#)".}
-
https://nodejs.org/api/worker_threads.html#worker_threads_worker_getenvironmentdata_key
func isMainThread(): bool {.importjs: "worker_threads.$1()".}
-
https://nodejs.org/api/worker_threads.html#worker_threads_worker_ismainthread
func markAsUntransferable(objct: JsObject) {.importjs: "worker_threads.$1(#)".}
-
https://nodejs.org/api/worker_threads.html#worker_threads_worker_markasuntransferable_object
func moveMessagePortToContext(port: MessagePort; contextifiedSandbox: JsObject): MessagePort {.
importjs: "worker_threads.$1(#)".}
-
https://nodejs.org/api/worker_threads.html#worker_threads_worker_movemessageporttocontext_port_contextifiedsandbox
func receiveMessageOnPort(port: MessagePort): JsObject {.
importjs: "worker_threads.$1(#)".}
-
https://nodejs.org/api/worker_threads.html#worker_threads_worker_receivemessageonport_port
func setEnvironmentData(key: auto; value: auto) {.
importjs: "worker_threads.$1(#)", discardable.}
-
https://nodejs.org/api/worker_threads.html#worker_threads_worker_setenvironmentdata_key_value
func close(self: BroadcastChannel or MessagePort) {.importjs: "#.$1()",
discardable.}
-
https://nodejs.org/api/worker_threads.html#worker_threads_broadcastchannel_close
func postMessage(self: BroadcastChannel or MessagePort or Worker; message: auto) {.
importjs: "#.$1(#)", discardable.}
-
https://nodejs.org/api/worker_threads.html#worker_threads_broadcastchannel_postmessage_message
func postMessage(self: MessagePort or Worker; message: auto;
transferList: openArray[JsObject]) {.importjs: "#.$1(#, #)",
discardable.}
-
https://nodejs.org/api/worker_threads.html#worker_threads_port_postmessage_value_transferlist
func refs(self: BroadcastChannel or MessagePort or Worker) {.
importjs: "#.ref()", discardable.}
-
https://nodejs.org/api/worker_threads.html#worker_threads_broadcastchannel_ref
func unrefs(self: BroadcastChannel or MessagePort or Worker) {.
importjs: "#.unref()", discardable.}
-
https://nodejs.org/api/worker_threads.html#worker_threads_broadcastchannel_unref
func start(self: MessagePort) {.importjs: "#.$1()", discardable.}
-
https://nodejs.org/api/worker_threads.html#worker_threads_port_start
func terminate(self: Worker): Future[cstring] {.importjs: "#.$1()".}
-
https://nodejs.org/api/worker_threads.html#worker_threads_worker_terminate
func on[T](self: MessagePort; callback: T) {.importjs: "#.on(#)", discardable.}
-