Latest 1.0.1
Homepage https://github.com/paulmelnikow/SimpleObjectPool
License Apache 2.0
Platforms osx , ios , tvos , watchos , requires ARC
Authors

Simple implementation of a thread-safe object pool.

Version
License
Platform
Build

Pool

Usage

When the pool is empty, it naively creates another object using the
createBlock.

ObjectPool *pool = [ObjectPool poolWithCreateBlock:^id(NSError **outError) {
    NSLog(@"Opening database connection");
    MyDBConnection *connection = [MyDBConnection connection]
    if (![connection openWithError:outError])
        return nil;
    else
        return connection;
}];

MyDBConnection *connection = [pool objectFromPoolWithError:nil];

// do stuff with connection

[pool returnObjectToPool:connection];

Installation

Install via CocoaPods.

Contribute

Pull requests welcome!

Support

If you are having issues, please let me know.

Development

This project includes unit tests. To run them, run pod install inside the
TestProject folder, then load the workspace and execute the test action.

License

This project is licensed under the Apache license.

Latest podspec

{
    "name": "SimpleObjectPool",
    "version": "1.0.1",
    "summary": "Simple thread-safe object pool in Objective-C",
    "description": "Simple implementation of a thread-safe object pool.nWhen the pool is empty, it naively creates anothernobject using a block provided.",
    "homepage": "https://github.com/paulmelnikow/SimpleObjectPool",
    "license": "Apache 2.0",
    "authors": {
        "Paul Melnikow": "[email protected]"
    },
    "source": {
        "git": "https://github.com/paulmelnikow/SimpleObjectPool.git",
        "tag": "1.0.1"
    },
    "requires_arc": true,
    "source_files": "*.{h,m}",
    "platforms": {
        "osx": null,
        "ios": null,
        "tvos": null,
        "watchos": null
    }
}

Pin It on Pinterest

Share This