Packages

c

scala.scalajs.js

FinalizationRegistry

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])

Value Members

  1. final def !=(arg0: scala.Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    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)
    Implicit
    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
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  8. def ensuring(cond: (FinalizationRegistry[A, B, C]) ⇒ Boolean, msg: ⇒ scala.Any): FinalizationRegistry[A, B, C]
    Implicit
    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]
    Implicit
    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]
    Implicit
    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]
    Implicit
    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
    Definition Classes
    AnyRef
  13. def equals(arg0: scala.Any): Boolean
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def formatted(fmtstr: String): String
    Implicit
    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[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def hasOwnProperty(v: String): Boolean

    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
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. def isPrototypeOf(v: Object): Boolean

    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
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. def propertyIsEnumerable(v: String): Boolean

    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

    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

    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
    Definition Classes
    AnyRef
  28. def toLocaleString(): String
    Definition Classes
    Object
  29. def toString(): String
    Definition Classes
    AnyRef → Any
  30. def unregister(unregistrationToken: C): Boolean

    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
    Definition Classes
    Object
  32. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  35. def [B](y: B): (FinalizationRegistry[A, B, C], B)
    Implicit
    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