ResourcePool
Object Hierarchy:
Bump.ResourcePool
Bump.ResourcePool
Bump.ResourcePool
Bump.Factory
Bump.Factory
Bump.Factory->Bump.ResourcePool
GLib.Object
GLib.Object
GLib.Object->Bump.Factory
Description:
public class ResourcePool <
T > :
Factory <
T >
Pool of reusable resources
This class is designed to help manage a group of reusable resources, especially those that are expensive to acquire. The pool will
automatically grow, and shrink, as required.
Content:
Properties:
Delegates:
Creation methods:
Methods:
public override unowned T acquire (int priority = DEFAULT , Cancellable ? cancellable = null ) throws Error
Synchronously acquire a resource
public override async unowned T acquire_async (int priority = DEFAULT , Cancellable ? cancellable = null ) throws Error
Asynchronously acquire a resource
public override async unowned T acquire_background (int priority = DEFAULT , Cancellable ? cancellable = null ) throws Error
Asynchronously acquire a resource in a background thread
public ResourceClaim <T > claim (int priority = DEFAULT , Cancellable ? cancellable = null ) throws Error
Acquire a claim
public async ResourceClaim <T > claim_async (int priority = DEFAULT , Cancellable ? cancellable = null ) throws Error
Acquire a claim asynchronously
public R execute <R > (Callback <T ,R > func, int priority = DEFAULT , Cancellable ? cancellable = null ) throws Error
Execute a callback which uses a resource
public async R execute_async <R > (owned Callback <T ,R > func, int priority = DEFAULT , Cancellable ? cancellable = null ) throws Error
Asynchronously execute a callback which uses a resource
public async R execute_background <R > (owned Callback <T ,R > func, int priority = DEFAULT , Cancellable ? cancellable = null ) throws Error
Execute a callback in a background thread which uses a resource
public virtual void release (T resource)
Release a resource into the pool
Inherited Members:
All known members inherited from class Bump.Factory
All known members inherited from class GLib.Object