Skip to content

Commit

Permalink
Improve README (maybe)
Browse files Browse the repository at this point in the history
  • Loading branch information
cressie176 committed Aug 26, 2023
1 parent d004dff commit ed006e0
Showing 1 changed file with 11 additions and 34 deletions.
45 changes: 11 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,40 +308,17 @@ Migrating from [generic-pool](https://github.com/coopernurse/node-pool) is relat

### API

#### acquire(priority? : number) : Promise<T>
acquire() : Promise<T>

X-Pool does not currently support priorities. If you need this feature please create an issue.

#### isBorrowedResource() : boolean
This method is not necessary since returning an unmanaged resource to the pool will have no effect.

#### release(resource : T) : Promise<void>
release(resource : T) : void |

Releasing resources is a synchronous operation hence we do not return a promise.

#### destroy(resource : T) : Promise<void>
destroy(resource : T) : void

Resources are destroyed in the background so we do not return a promise.

#### start() : void
initialise() : Promise<void>

Resolves once the minimum number of resources have been added to the pool, or rejects if the optional `initialiseTimeout` is exceeded. You do not need to wait for the initialise method to resolve if you do not want to.

#### ready() : void
Await the initialise method or listen for the InitialisePoolOperation.SUCCEEDED event.

#### use((resource: T) => Promise<any>) : Promise<any>
with((resource: T) => Promise<any>) : Promise<any>

#### drain() : Promise<void>
shutdown() : Promise<void>

#### clear() : Promise<void> Not Supported
Not necessary with X-Pool
| Generic Pool | X-Pool | Notes |
| ------------------ | -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| acquire | acquire() : Promise<T> | X-Pool does not currently support priorities |
| isBorrowedResource | Not Supported | This method is not necessary since returning an unmanaged resource to the pool will have no effect |
| release | release(resource : T) : void | Releasing resources is a synchronous operation hence the method does not return a promise |
| destroy | destroy(resource : T) : void | Resources are destroyed in the background hence the method does not return a promise |
| start | initialise() : Promise<void> | Resolves once the minimum number of resources have been added to the pool, or rejects if the optional `initialiseTimeout` is exceeded. You do not need to wait for the initialise method to resolve if you do not want to. |
| ready | Not Supported | Await the initialise method instead. |
| use | with((resource: T) => Promise<any>) : Promise<any> | |
| drain | shutdown() : Promise<void> | |
| clear | Not Supported | Not necessary with X-Pool |

### Events

Expand Down

0 comments on commit ed006e0

Please sign in to comment.