Skip to content

[FEATURE] Return API #18

Description

@mackysoft

I would like to have such an API for simpler object return to a pool.

Fluid Syntax

// When an instance is disabled, it is returned to a pool.
var instance = m_Pool.Rent()
    .ReturnOnDisable(m_Pool); // Attach OnDisableTrigger

Disposable pattern

var disposable = m_Pool.Rent(out var instance);

// Return to a pool in callbacks such as object completion.
instance.OnCompleted = () => disposable.Dispose();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions