Enumeration ResourceAllocationMethod

Fileoverview

A generic resource pool implementation that supports concurrent use of a single resource. A resource goes through a number of lifecycle phases in a resource pool.

  • Creation started but not yet completed, available. Such a resource has a resourceRecord tracked by the pool and can be leased to a pool consumer (the .acquire call will wait for the .resourceRef promise to resolve).
  • Creation completed, available. Such a resource has a resourceRecord with a fully resolved .resourceRef and can be leased to a pool consumer (the .acquire call will resolve immediately if available).
  • Retirement started, unavailable. Such a resource has hit its maximum lifetime and can no longer be leased to new pool consumers. The pool will wait for active leases to expire before destroying the resource.
  • Destroy started, unavailable. Such a resource has already started to be destroyed, has no active leases, and cannot be leased to new pool consumers.
  • Destroy complete, unavailable. Such a resource is no longer tracked by the resource pool, its resourceRecord is dereferenced, and cannot be leased to new pool consumers.

Enumeration Members

Enumeration Members

EAGER: "eager"

Creates resources until maxResources. Prioritizes even distribution per resource.

LAZY: "lazy"

Creates resources only when necessary. Prioritizes reuse of existing resources.

Generated using TypeDoc