class AsyncResource extends Object with StObject
The class AsyncResource was designed to be extended by the embedder's async resources. Using this users can easily trigger the lifetime events of their own resources.
- Annotations
- @JSType() @JSImport("async_hooks", "AsyncResource") @native()
- Source
- asyncHooksMod.scala
- Alphabetic
- By Inheritance
- AsyncResource
- StObject
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new AsyncResource(type: java.lang.String, triggerAsyncId: Double)
- new AsyncResource(type: java.lang.String, triggerAsyncId: AsyncResourceOptions)
- new AsyncResource(type: java.lang.String)
AsyncResource() is meant to be extended.
AsyncResource() is meant to be extended. Instantiating a new AsyncResource() also triggers init. If triggerAsyncId is omitted then async_hook.executionAsyncId() is used.
- type
The type of async event.
- new AsyncResource()
- 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
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asyncId(): Double
- returns
the unique ID assigned to this AsyncResource instance.
- def bind[Func](fn: Func): Func with anon.AsyncResource
Binds the given function to execute to this
AsyncResource's scope.Binds the given function to execute to this
AsyncResource's scope.- fn
The function to bind to the current
AsyncResource.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- def emitDestroy(): AsyncResource.this.type
Call AsyncHooks destroy callbacks.
- 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 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 propertyIsEnumerable(v: scala.Predef.String): Boolean
- Definition Classes
- Object
- def runInAsyncScope[This, Result](fn: ThisFunction1[This, Any, Result], thisArg: Unit, args: Any*): Result
- def runInAsyncScope[This, Result](fn: ThisFunction1[This, Any, Result], thisArg: This, args: Any*): Result
Call the provided function with the provided arguments in the execution context of the async resource.
Call the provided function with the provided arguments in the execution context of the async resource. This will establish the context, trigger the AsyncHooks before callbacks, call the function, trigger the AsyncHooks after callbacks, and then restore the original execution context.
- fn
The function to call in the execution context of this async resource.
- thisArg
The receiver to be used for the function call.
- args
Optional arguments to pass to the function.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toLocaleString(): scala.Predef.String
- Definition Classes
- Object
- def toString(): java.lang.String
- Definition Classes
- AnyRef → Any
- def triggerAsyncId(): Double
- returns
the trigger ID for this AsyncResource instance.
- 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