On this page:
Custodian
Custodian.shutdown_  all
Custodian.is_  shutdown
Custodian.current
8.16.0.2

16.1 Custodians🔗ℹ

 import: rhombus/custodian package: rhombus-lib

A custodian manages objects such as threads, file-stream ports, network connections, and other custodians. Whenever a thread, etc., is created, it is placed under the management of the current custodian as determined by the Custodian.current parameter.

class

class Custodian():

  constructor (~parent: cust :: Custodian = Custodian.current())

Represents a custodian.

A new custodian is always created with some existing custodian as its parent. If the parent custodian is shutdown, then the child is shutdown, too.

method

method (cust :: Custodian).shutdown_all() :: Void

 

method

method (cust :: Custodian).is_shutdown() :: Boolean

The Custodian.shutdown_all method closes all objects managed by cust.

The Custodian.is_shutdown method reports whether a custodian has been shutdown already. A custodian that has been shutdown cannot become the owner of new objects.

A context parameter that determines the custodian for newly created object such as threads and file-stream ports.