Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
cressie176 authored Aug 11, 2023
1 parent 3221acf commit 5df8963
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,16 @@ Initialisise the pool, only yielding after the minimum number of resources have
```js
const resource = await pool.acquire();
```
Acquires and validates a resource from the pool, creating one if necessary as long as the optional maximum pool size has not been reached. If the pool is exhausted this method will block until a resource becomes available or the acquireTimeout is exceeded. If the acquireTimeout is exceed the method will reject. Resources created after the timeout is exceeded will be added to the pool.
Acquires and validates a resource from the pool, creating one if necessary as long as the optional maximum pool size has not been reached. If the create or validate fails acquition will be retried after the `acquireRetryInterval`. If the pool is exhausted this method will block until a resource becomes available or the `acquireTimeout` is exceeded. If the `acquireTimeout` is exceed the method will reject. Resources created after the timeout is exceeded will be added to the pool.

There are equally strong arguments to re-issue the most recently used reosurce as as the least recently used. X-Pool deliberately offers no guarantees of the order in which idle resources are re-issued, and instead provides the option of keeping the resources warm by revalidating idle resources reguarly via the `revalidateInterval` configuration option.

#### Errors

| Code | Notes |
| ----------------------------------- | -------------------------------- |
| ERR_X‑POOL_OPERATION_TIMEDOUT | The acquire timeout was exceeded |
| ERR_X‑POOL_SHUTDOWN_FAILED | The pool has been shutdown |
| Code | Notes |
| ----------------------------------- | --------------------------------------------------------------------------- |
| ERR_X‑POOL_OPERATION_TIMEDOUT | The acquire timeout was exceeded |
| ERR_X‑POOL_OPERATION_FAILED | The resource could not be acquired (e.g. because the pool is shutting down) |

### release(resource: T) : void
```js
Expand Down

0 comments on commit 5df8963

Please sign in to comment.