Skip to content

Does terminator need to be created before accepting connections? #42

@devinivy

Description

@devinivy

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:

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();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions