Add the ability to specify the max number of waiters for a resource
pool, this provides a more efficient way of avoiding waiters for a
resource pool continually rising.
This commit also improves the destroy behaviour.
This turned out not to be useful, since I wanted to handle exceptions
happening in the exception handler, so it didn't really help in the
end to allow customising it.
I think this needs more work, maybe the thread pool should be more
similar to the resource pool, but I think the name change is still
helpful.
Maybe there's a need for a variable size thread pool and that can
better integrate with the work queue.
Mostly to no longer sleep in the main fiber. Now the main fiber just
spawns other fibers when it would previously block on put-operation
and these other fibers communicate back to the main resource pool
fiber when necessary.
This should mean that the resource pool is more responsive.
Instead of batching the list items, change the batch size to a
parallelism limit and run up to that many fibers. When the processing
of one list item finishes, another will then start immediately after,
rather than when the whole batch is finished.
These changes also make the fibers-map and fibers-for-each operations
work with vectors as well as lists.