Class

scala.scalajs.js

FinalizationRegistry

Related Doc: package js

Permalink

class FinalizationRegistry[-A, -B, -C] extends Object

ECMAScript 2021

A FinalizationRegistry object lets you request a callback when an object is garbage-collected.

FinalizationRegistry provides a way to request that a cleanup callback get called at some point when an object registered with the registry has been reclaimed (garbage-collected). (Cleanup callbacks are sometimes called finalizers.)

MDN

A

Type of the target object to register

B

Type of value to pass to the finalizer

C

Type of an unregistration token

Annotations
@JSType() @native() @JSGlobal()
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FinalizationRegistry
  2. Object
  3. Any
  4. AnyRef
  5. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new FinalizationRegistry(finalizer: Function1[B, scala.Any])

    Permalink

Value Members

  1. final def !=(arg0: scala.Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from FinalizationRegistry[A, B, C] to any2stringadd[FinalizationRegistry[A, B, C]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (FinalizationRegistry[A, B, C], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from FinalizationRegistry[A, B, C] to ArrowAssoc[FinalizationRegistry[A, B, C]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: scala.Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def ensuring(cond: (FinalizationRegistry[A, B, C]) ⇒ Boolean, msg: ⇒ scala.Any): FinalizationRegistry[A, B, C]

    Permalink
    Implicit information
    This member is added by an implicit conversion from FinalizationRegistry[A, B, C] to Ensuring[FinalizationRegistry[A, B, C]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (FinalizationRegistry[A, B, C]) ⇒ Boolean): FinalizationRegistry[A, B, C]

    Permalink
    Implicit information
    This member is added by an implicit conversion from FinalizationRegistry[A, B, C] to Ensuring[FinalizationRegistry[A, B, C]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: ⇒ scala.Any): FinalizationRegistry[A, B, C]

    Permalink
    Implicit information
    This member is added by an implicit conversion from FinalizationRegistry[A, B, C] to Ensuring[FinalizationRegistry[A, B, C]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): FinalizationRegistry[A, B, C]

    Permalink
    Implicit information
    This member is added by an implicit conversion from FinalizationRegistry[A, B, C] to Ensuring[FinalizationRegistry[A, B, C]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def equals(arg0: scala.Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from FinalizationRegistry[A, B, C] to StringFormat[FinalizationRegistry[A, B, C]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  16. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  17. def hasOwnProperty(v: String): Boolean

    Permalink

    Tests whether this object has the specified property as a direct property.

    Tests whether this object has the specified property as a direct property.

    Unlike js.Object.hasProperty, this method does not check down the object's prototype chain.

    MDN

    Definition Classes
    Object
  18. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  19. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  20. def isPrototypeOf(v: Object): Boolean

    Permalink

    Tests whether this object is in the prototype chain of another object.

    Tests whether this object is in the prototype chain of another object.

    Definition Classes
    Object
  21. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. def propertyIsEnumerable(v: String): Boolean

    Permalink

    Tests whether the specified property in an object can be enumerated by a call to js.Object.properties, with the exception of properties inherited through the prototype chain.

    Tests whether the specified property in an object can be enumerated by a call to js.Object.properties, with the exception of properties inherited through the prototype chain.

    If the object does not have the specified property, this method returns false.

    MDN

    Definition Classes
    Object
  25. def register(theObject: A, heldValue: B): Unit

    Permalink

    The register method registers an object with a FinalizationRegistry instance so that if the object is garbage-collected, the registry's callback may get called.

    The register method registers an object with a FinalizationRegistry instance so that if the object is garbage-collected, the registry's callback may get called.

    theObject

    The target object to register.

    heldValue

    The value to pass to the finalizer for this object. This cannot be the target object.

  26. def register(theObject: A, heldValue: B, unregistrationToken: C): Unit

    Permalink

    The register method registers an object with a FinalizationRegistry instance so that if the object is garbage-collected, the registry's callback may get called.

    The register method registers an object with a FinalizationRegistry instance so that if the object is garbage-collected, the registry's callback may get called.

    theObject

    The target object to register.

    heldValue

    The value to pass to the finalizer for this object. This cannot be the target object.

    unregistrationToken

    A token that may be used with the unregister method later to unregister the target object. If provided (and not undefined), this must be an object. If not provided, the target cannot be unregistered.

  27. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  28. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  29. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  30. def unregister(unregistrationToken: C): Boolean

    Permalink

    The unregister unregisters a target object from a FinalizationRegistry instance.

    The unregister unregisters a target object from a FinalizationRegistry instance.

    When a target object has been reclaimed, it is no longer registered in the registry. There is no need to all unregister in your cleanup callback. Only call unregister if you haven't received a cleanup callback and no longer need to receive one.

    unregistrationToken

    The token used with the register method when registering the target object.

  31. def valueOf(): scala.Any

    Permalink
    Definition Classes
    Object
  32. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. def [B](y: B): (FinalizationRegistry[A, B, C], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from FinalizationRegistry[A, B, C] to ArrowAssoc[FinalizationRegistry[A, B, C]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from scala.Any

Inherited by implicit conversion any2stringadd from FinalizationRegistry[A, B, C] to any2stringadd[FinalizationRegistry[A, B, C]]

Inherited by implicit conversion StringFormat from FinalizationRegistry[A, B, C] to StringFormat[FinalizationRegistry[A, B, C]]

Inherited by implicit conversion Ensuring from FinalizationRegistry[A, B, C] to Ensuring[FinalizationRegistry[A, B, C]]

Inherited by implicit conversion ArrowAssoc from FinalizationRegistry[A, B, C] to ArrowAssoc[FinalizationRegistry[A, B, C]]

Ungrouped