Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mmzeeman/tubby

A process pool for running tasks.
https://github.com/mmzeeman/tubby

Last synced: about 16 hours ago
JSON representation

A process pool for running tasks.

Awesome Lists containing this project

README

        

Tubby
=====

A process pool for running tasks.

Example

```erlang
tubby:start(my_worker_pool, {my_worker, start_link, []}),

%% Start a worker on the pool.
{ok, Pid} = tubby:run(my_worker_pool, [Arg1, Arg2]),
my_worker:do_stuff(Pid, Stuff),

%% Queue a worker on the pool. The task will run when there is room
ok = tubby:queue(my_worker_pool, [Arg1, Arg2]),

%% Or queue it, and wait for 10000 msecs until there is room.
{ok, Pid} = tubby:queue_wait(my_worker_pool, [Arg1, Arg2], 10000),
```