class Worker extends Object with StObject
- Annotations
- @JSType() @JSImport("worker_threads", "Worker") @native()
- Source
- workerThreadsMod.scala
- Alphabetic
- By Inheritance
- Worker
- StObject
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Worker(filename: java.lang.String, options: WorkerOptions)
- new Worker(filename: URL_, options: WorkerOptions)
- new Worker(filename: java.lang.String)
- filename
The path to the Worker’s main script or module. Must be either an absolute path or a relative path (i.e. relative to the current working directory) starting with ./ or ../, or a WHATWG URL object using file: protocol. If options.eval is true, this is a string containing JavaScript code rather than a path.
- new Worker(filename: URL_)
- new Worker()
- Attributes
- protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def addListener(event: Symbol, listener: Function1[Any, Unit]): Worker.this.type
- def addListener(event: java.lang.String, listener: Function1[Any, Unit]): Worker.this.type
- def addListener_error(event: error, listener: Function1[Error, Unit]): Worker.this.type
- Annotations
- @JSName("addListener")
- def addListener_exit(event: exit, listener: Function1[Double, Unit]): Worker.this.type
- Annotations
- @JSName("addListener")
- def addListener_message(event: message, listener: Function1[Any, Unit]): Worker.this.type
- Annotations
- @JSName("addListener")
- def addListener_messageerror(event: messageerror, listener: Function1[Error, Unit]): Worker.this.type
- Annotations
- @JSName("addListener")
- def addListener_online(event: online, listener: Function0[Unit]): Worker.this.type
- Annotations
- @JSName("addListener")
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- def emit(event: Symbol, args: Any*): Boolean
- def emit(event: java.lang.String, args: Any*): Boolean
- def emit_error(event: error, err: Error): Boolean
- Annotations
- @JSName("emit")
- def emit_exit(event: exit, exitCode: Double): Boolean
- Annotations
- @JSName("emit")
- def emit_message(event: message, value: Any): Boolean
- Annotations
- @JSName("emit")
- def emit_messageerror(event: messageerror, error: Error): Boolean
- Annotations
- @JSName("emit")
- def emit_online(event: online): Boolean
- Annotations
- @JSName("emit")
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def getHeapSnapshot(): Promise[Readable]
Returns a readable stream for a V8 snapshot of the current state of the Worker.
Returns a readable stream for a V8 snapshot of the current state of the Worker. See
v8.getHeapSnapshot()for more details.If the Worker thread is no longer running, which may occur before the
'exit'event is emitted, the returnedPromisewill be rejected immediately with anERR_WORKER_NOT_RUNNINGerror - def hasOwnProperty(v: scala.Predef.String): Boolean
- Definition Classes
- Object
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- def off(event: Symbol, listener: Function1[Any, Unit]): Worker.this.type
- def off(event: java.lang.String, listener: Function1[Any, Unit]): Worker.this.type
- def off_error(event: error, listener: Function1[Error, Unit]): Worker.this.type
- Annotations
- @JSName("off")
- def off_exit(event: exit, listener: Function1[Double, Unit]): Worker.this.type
- Annotations
- @JSName("off")
- def off_message(event: message, listener: Function1[Any, Unit]): Worker.this.type
- Annotations
- @JSName("off")
- def off_messageerror(event: messageerror, listener: Function1[Error, Unit]): Worker.this.type
- Annotations
- @JSName("off")
- def off_online(event: online, listener: Function0[Unit]): Worker.this.type
- Annotations
- @JSName("off")
- def on(event: Symbol, listener: Function1[Any, Unit]): Worker.this.type
- def on(event: java.lang.String, listener: Function1[Any, Unit]): Worker.this.type
- def on_error(event: error, listener: Function1[Error, Unit]): Worker.this.type
- Annotations
- @JSName("on")
- def on_exit(event: exit, listener: Function1[Double, Unit]): Worker.this.type
- Annotations
- @JSName("on")
- def on_message(event: message, listener: Function1[Any, Unit]): Worker.this.type
- Annotations
- @JSName("on")
- def on_messageerror(event: messageerror, listener: Function1[Error, Unit]): Worker.this.type
- Annotations
- @JSName("on")
- def on_online(event: online, listener: Function0[Unit]): Worker.this.type
- Annotations
- @JSName("on")
- def once(event: Symbol, listener: Function1[Any, Unit]): Worker.this.type
- def once(event: java.lang.String, listener: Function1[Any, Unit]): Worker.this.type
- def once_error(event: error, listener: Function1[Error, Unit]): Worker.this.type
- Annotations
- @JSName("once")
- def once_exit(event: exit, listener: Function1[Double, Unit]): Worker.this.type
- Annotations
- @JSName("once")
- def once_message(event: message, listener: Function1[Any, Unit]): Worker.this.type
- Annotations
- @JSName("once")
- def once_messageerror(event: messageerror, listener: Function1[Error, Unit]): Worker.this.type
- Annotations
- @JSName("once")
- def once_online(event: online, listener: Function0[Unit]): Worker.this.type
- Annotations
- @JSName("once")
- val performance: WorkerPerformance
- def postMessage(value: Any, transferList: Array[TransferListItem]): Unit
- def postMessage(value: Any): Unit
- def prependListener(event: Symbol, listener: Function1[Any, Unit]): Worker.this.type
- def prependListener(event: java.lang.String, listener: Function1[Any, Unit]): Worker.this.type
- def prependListener_error(event: error, listener: Function1[Error, Unit]): Worker.this.type
- Annotations
- @JSName("prependListener")
- def prependListener_exit(event: exit, listener: Function1[Double, Unit]): Worker.this.type
- Annotations
- @JSName("prependListener")
- def prependListener_message(event: message, listener: Function1[Any, Unit]): Worker.this.type
- Annotations
- @JSName("prependListener")
- def prependListener_messageerror(event: messageerror, listener: Function1[Error, Unit]): Worker.this.type
- Annotations
- @JSName("prependListener")
- def prependListener_online(event: online, listener: Function0[Unit]): Worker.this.type
- Annotations
- @JSName("prependListener")
- def prependOnceListener(event: Symbol, listener: Function1[Any, Unit]): Worker.this.type
- def prependOnceListener(event: java.lang.String, listener: Function1[Any, Unit]): Worker.this.type
- def prependOnceListener_error(event: error, listener: Function1[Error, Unit]): Worker.this.type
- Annotations
- @JSName("prependOnceListener")
- def prependOnceListener_exit(event: exit, listener: Function1[Double, Unit]): Worker.this.type
- Annotations
- @JSName("prependOnceListener")
- def prependOnceListener_message(event: message, listener: Function1[Any, Unit]): Worker.this.type
- Annotations
- @JSName("prependOnceListener")
- def prependOnceListener_messageerror(event: messageerror, listener: Function1[Error, Unit]): Worker.this.type
- Annotations
- @JSName("prependOnceListener")
- def prependOnceListener_online(event: online, listener: Function0[Unit]): Worker.this.type
- Annotations
- @JSName("prependOnceListener")
- def propertyIsEnumerable(v: scala.Predef.String): Boolean
- Definition Classes
- Object
- def ref(): Unit
- def removeListener(event: Symbol, listener: Function1[Any, Unit]): Worker.this.type
- def removeListener(event: java.lang.String, listener: Function1[Any, Unit]): Worker.this.type
- def removeListener_error(event: error, listener: Function1[Error, Unit]): Worker.this.type
- Annotations
- @JSName("removeListener")
- def removeListener_exit(event: exit, listener: Function1[Double, Unit]): Worker.this.type
- Annotations
- @JSName("removeListener")
- def removeListener_message(event: message, listener: Function1[Any, Unit]): Worker.this.type
- Annotations
- @JSName("removeListener")
- def removeListener_messageerror(event: messageerror, listener: Function1[Error, Unit]): Worker.this.type
- Annotations
- @JSName("removeListener")
- def removeListener_online(event: online, listener: Function0[Unit]): Worker.this.type
- Annotations
- @JSName("removeListener")
- val resourceLimits: UndefOr[ResourceLimits_]
- val stderr: Readable
- val stdin: |[Writable, Null]
- val stdout: Readable
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def terminate(): Promise[Double]
Stop all JavaScript execution in the worker thread as soon as possible.
Stop all JavaScript execution in the worker thread as soon as possible. Returns a Promise for the exit code that is fulfilled when the
exitevent is emitted. - val threadId: Double
- def toLocaleString(): scala.Predef.String
- Definition Classes
- Object
- def toString(): java.lang.String
- Definition Classes
- AnyRef → Any
- def unref(): Unit
- def valueOf(): Any
- Definition Classes
- Object
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated