Skip to content

Commit

Permalink
Improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
cressie176 committed Aug 26, 2023
1 parent 10913dd commit a13cc41
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,22 +228,22 @@ You can configure the pool to shrink back to the `minSize` when it is not busy b
X-Pool uses the NodeJS EventEmitter to expose information about the pool internals. Each high level operation, e.g. initialise, acquire, release, etc. has a corresponding Operation class. When the operation runs, the Pool will emit events corresponding to the start of the operation, the success of the operation or the failure of the operation.
Some operations may emit additional events signifying an important state change within the pool. The potential events are as follows:

| Event | Code |
| --------------------------------------- | ------------------------------------------------------------------------- |
| XPoolEvent | N/A the class is emitted |
| XPoolOperation | N/A the class is emitted |
| InitialisePoolOperation[subtype] | X‑POOL_INITIALISE_POOL_[STARTED\|NOTICE\|SUCCEEDED\|FAILED] |
| ShutdownPoolOperation[subtype] | X‑POOL_SHUTDOWN_POOL_[STARTED\|NOTICE\|SUCCEEDED\|FAILED] |
| AcquireResourceOperation[subtype] | X‑POOL_ACQUIRE_RESOURCE_[STARTED\|NOTICE\|SUCCEEDED\|FAILED] |
| CreateResourceOperation[subtype] | X‑POOL_CREATE_RESOURCE_[STARTED\|NOTICE\|SUCCEEDED\|FAILED] |
| ValidateResourceOperation[subtype] | X‑POOL_VALIDATE_RESOURCE_[STARTED\|NOTICE\|SUCCEEDED\|FAILED] |
| ReleaseResourceOperation[subtype] | X‑POOL_RELEASE_RESOURCE_[STARTED\|NOTICE\|SUCCEEDED\|FAILED] |
| WithResourceOperation[subtype] | X‑POOL_WITH_RESOURCE_[STARTED\|NOTICE\|SUCCEEDED\|FAILED] |
| DestroyResourceOperation[subtype] | X‑POOL_DESTROY_RESOURCE_[STARTED\|NOTICE\|SUCCEEDED\|FAILED] |
| EvictBadResourcesOperation[subtype] | X‑POOL_EVICT_BAD_RESOURCES_[STARTED\|NOTICE\|SUCCEEDED\|FAILED] |
| DestroySpareResourcesOperation[subtype] | X‑POOL_DESTROY_SPARE_RESOURCES_[STARTED\|NOTICE\|SUCCEEDED\|FAILED] |

Where [subtype] can be one of `STARTED`, `NOTICE`, `SUCCEEDED` or `FAILED`.
| Event | Code |
| -------------------------------------- | -------------------------------------------- |
| XPoolEvent | N/A the class is emitted |
| XPoolOperation | N/A the class is emitted |
| InitialisePoolOperation.${TYPE} | X‑POOL_INITIALISE_POOL_${TYPE} |
| ShutdownPoolOperation.${TYPE} | X‑POOL_SHUTDOWN_POOL_${TYPE} |
| AcquireResourceOperation.${TYPE} | X‑POOL_ACQUIRE_RESOURCE_${TYPE} |
| CreateResourceOperation.${TYPE} | X‑POOL_CREATE_RESOURCE_${TYPE} |
| ValidateResourceOperation.${TYPE} | X‑POOL_VALIDATE_RESOURCE_${TYPE} |
| ReleaseResourceOperation.${TYPE} | X‑POOL_RELEASE_RESOURCE_${TYPE} |
| WithResourceOperation.${TYPE} | X‑POOL_WITH_RESOURCE_${TYPE} |
| DestroyResourceOperation.${TYPE} | X‑POOL_DESTROY_RESOURCE_${TYPE} |
| EvictBadResourcesOperation.${TYPE} | X‑POOL_EVICT_BAD_RESOURCES_${TYPE} |
| DestroySpareResourcesOperation.${TYPE} | X‑POOL_DESTROY_SPARE_RESOURCES_${TYPE} |

Where TYPE can be one of `STARTED`, `NOTICE`, `SUCCEEDED` or `FAILED`.

- All `STARTED` events include a `code` and `message`.
- All `NOTICE` events include a `code` and `message`.
Expand Down

0 comments on commit a13cc41

Please sign in to comment.