src/nodejs/jscluster

  Source   Edit

  • Multiprocessing, Process Pool with IPC.
Warning: Module currently not working, Pull Requests welcome.

Types

Cluster = ref object of JsRoot
  isMaster*, isPrimary*, isWorker*: bool
  schedulingPolicy*: cstring
  settings*, worker*, workers*: JsObject
https://nodejs.org/api/cluster.html#cluster_cluster   Source   Edit

Procs

func importCluster() {.importjs: "import * as cluster from \'cluster\'@",
                       ...raises: [], tags: [].}
Alias for import * as module_name from 'module_name';. Must be called once before using the module   Source   Edit
func isMaster(): bool {.importjs: "(cluster.isPrimary)@", ...raises: [], tags: [].}
  Source   Edit
func isPrimary(): bool {.importjs: "(cluster.isPrimary)@", ...raises: [], tags: [].}
  Source   Edit
func isWorker(): bool {.importjs: "(cluster.isWorker)@", ...raises: [], tags: [].}
  Source   Edit
func kill(self: Worker; signal = "SIGTERM".cstring) {.importjs: "#.$1(#)",
    discardable, ...raises: [], tags: [].}
https://nodejs.org/api/cluster.html#cluster_worker_kill_signal   Source   Edit
func on[T](self: Worker; event: cstring; callback: T) {.importjs: "#.on(#, #)",
    discardable, ...raises: [], tags: [].}
  Source   Edit
func requireCluster() {.importjs: "const cluster = require(\'cluster\')@",
                        ...raises: [], tags: [].}
Alias for const module_name = require('module_name');. Must be called once before using the module   Source   Edit

Iterators

iterator clusterWorkers(): Worker {....raises: [], tags: [].}
  Source   Edit

Templates

template onDisconnect(self: Worker; callback)
Alias for httpServer.on(event = cstring("disconnect"), callback).   Source   Edit
template onError(self: Worker; callback)
Alias for httpServer.on(event = cstring("error"), callback).   Source   Edit
template onExit(self: Worker; callback)
Alias for httpServer.on(event = cstring("exit"), callback).   Source   Edit
template onFork(self: Worker; callback)
Alias for httpServer.on(event = cstring("fork"), callback).   Source   Edit
template onListening(self: Worker; callback)
Alias for httpServer.on(event = cstring("listening"), callback).   Source   Edit
template onMessage(self: Worker; callback)
Alias for httpServer.on(event = cstring("message"), callback).   Source   Edit
template onOnline(self: Worker; callback)
Alias for httpServer.on(event = cstring("online"), callback).   Source   Edit
template onSetup(self: Worker; callback)
Alias for httpServer.on(event = cstring("setup"), callback).   Source   Edit