UNPKG

@lodestar/beacon-node

Version:

A Typescript implementation of the beacon chain

26 lines 1.12 kB
import { Server } from "node:http"; import { Gauge, GaugeExtra } from "@lodestar/utils"; export type SocketMetrics = { activeSockets: GaugeExtra; socketsBytesRead: Gauge; socketsBytesWritten: Gauge; }; /** * From https://github.com/gajus/http-terminator/blob/aabca4751552e983f8a59ba896b7fb58ce3b4087/src/factories/createInternalHttpTerminator.ts#L24-L61 * But only handles HTTP sockets, exposes the count of sockets as metrics */ export declare class HttpActiveSocketsTracker { private readonly server; private sockets; private terminating; constructor(server: Server, metrics: SocketMetrics | null); /** * Wait for all connections to drain, forcefully terminate any open connections after timeout * * From https://github.com/gajus/http-terminator/blob/aabca4751552e983f8a59ba896b7fb58ce3b4087/src/factories/createInternalHttpTerminator.ts#L78-L165 * But only handles HTTP sockets and does not close server, immediately closes eventstream API connections */ terminate(): Promise<void>; private destroySocket; } //# sourceMappingURL=activeSockets.d.ts.map