Does terminator need to be created before accepting connections?
- Dominant language
- TypeScript
- Stars
- 335
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
Small question here! I know that http-terminator tracks some state about the server, e.g. active sockets, in order to do its job. Does that imply that the terminator needs to be created before the server starts serving requests, so that it can track the state of the server prior to termination? I think it could be easy to assume you can just create the terminator at the moment you want to start tearing down the server, so I want to confirm whether or not that is intended usage. Thank you!
Example:
```js
const server = http.createServer();
// Serve some requests
// Begin teardown
const httpTerminator = createHttpTerminator({ server });
await httpTerminator.terminate();
// ... or ...
const server = http.createServer();
const httpTerminator = createHttpTerminator({ server });
// Serve some requests
// Begin teardown
await httpTerminator.terminate();
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.