A dumb little resource pool.
{:ok, dial_pool} = Billiards.rack(resource: Dialer, workers: 4)
{:ok, phone_call_to_jenny } = Billiards.call dial_pool, {:dial, '867-5309'}
Billiards uses a dumb strategy to pick resources from the pool. Right now, it just takes the first available resource.
If all resources are busy, the calling process will block until a resource is available to serve it.
It's not advisable to use this
- One/both of:
- Timeouts, or
- Monitor failure in processes invoking
Billiards.call
A crash there will leave a resource in a 'busy' state.
- Write more tests.