-
-
Notifications
You must be signed in to change notification settings - Fork 23
How it works
BACK > Home
This page explains how the functionality behind kPooling works.
Data diagram for kPooling.
When the PoolingSystem is first accessed it uses reflection to gather Processor classes. These classes are used to process Pools as they are created and used. Once Processor classes are gathered they are cached and never gathered again.
When the user calls CreatePool<T> the PoolingSystem creates a new Pool using the generic type T. This type argument allows both type specific processing via Processor classes and returning instances directly as T. A Pool can only be created if the type T has an associated Processor class.
When the user calls GetInstance<T> the PoolingSystem iterates all Pools to find a Pool of matching type T. When a matching Pool is found a valid instance is returned.