Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessRefCount ¶
AccessRefCount adds a reference to the RefCount while the fn executes.
func WaitRefCount ¶
func WaitRefCount[T comparable]( ctx context.Context, target *ccontainer.CContainer[T], targetErr *ccontainer.CContainer[*error], ) (T, error)
WaitRefCount waits for a RefCount container handling errors. targetErr can be nil
Types ¶
type Ref ¶
type Ref[T comparable] struct { // contains filtered or unexported fields }
Ref is a reference to a RefCount.
type RefCount ¶
type RefCount[T comparable] struct { // contains filtered or unexported fields }
RefCount is a refcount driven object container. Wraps a ccontainer with a ref count mechanism. When there are no references, the container contents are released.
func NewRefCount ¶
func NewRefCount[T comparable]( ctx context.Context, target *ccontainer.CContainer[T], targetErr *ccontainer.CContainer[*error], resolver func(ctx context.Context) (T, func(), error), ) *RefCount[T]
NewRefCount builds a new RefCount. target and targetErr can be empty
Click to show internal directories.
Click to hide internal directories.