Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added CustomPoolableManager to work with IPoolable<T> objects in container #622

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Cerzi
Copy link

@Cerzi Cerzi commented Mar 29, 2019

A very simple modified version of PoolableManager that allows a facade class to forward an initialization parameter to objects in the subcontainer that implement IPoolable<T>.

This enables a clean way for all subcomponents to access the param data sent to the facade OnSpawned:

public void OnSpawned(ParamData data, IMemroyPool pool)
{
   _pool = pool;
   _customPoolableManager.TriggerOnSpawned(data);
}

//subcomponent.cs
public void OnSpawned(ParamData data)

Rather than having to do something like

public void OnSpawned() 
{
   _data = _facade.GetData();
}

in every subcomponent, which feels like a limitation of the current PoolableManager.

@svermeulen
Copy link

Makes sense, thanks. I've merged this into extenject with commit 226c911. I also added documentation for it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants