The type of objects managed by the pool. ObjectHandle
InternalCreates an instance of ObjectHandle.
The unique ID of the object within the pool.
The object instance this handle wraps.
The pool instance this handle belongs to. This constructor is intended for internal use by ObjectPool. Users should acquire handles via ObjectPool#acquire.
Gets the underlying object instance managed by this handle. Use this getter to access and modify the pooled object's properties.
The pooled object.
InternalFor pool internal use to reset state on acquire.
Implements the Symbol.dispose method for the 'using' keyword.
This allows the handle to be used with the using declaration (available in
environments supporting the Explicit Resource Management proposal, e.g., Node.js 20+).
When a using declaration goes out of scope, this method is automatically called,
ensuring the object is released back to the pool.
Releases the object back to the pool, making it available for reuse.
This method is idempotent; calling it multiple times on the same handle
instance will only release the object once.
After calling free(), the handle should no longer be used.
Description
A handle representing an object acquired from an ObjectPool. This handle is the primary way to interact with a pooled object and release it back to the pool. It provides a safe wrapper around the underlying object and prevents issues like double-freeing.