nice-grpc-server-middleware-terminator
Advanced tools
Comparing version
import { ServerMiddleware } from 'nice-grpc-common'; | ||
export type TerminatorContext = { | ||
/** | ||
* Mark the call as one that should be aborted when the server is shutting | ||
* down. | ||
*/ | ||
abortOnTerminate(): void; | ||
}; | ||
/** | ||
* Server middleware that makes it possible to prevent long-running calls from | ||
* blocking server graceful shutdown. | ||
*/ | ||
export type TerminatorMiddleware = ServerMiddleware<TerminatorContext> & { | ||
/** | ||
* Aborts all calls that have called `abortOnTerminate` and make them return | ||
* gRPC errors with status `UNAVAILABLE`. | ||
* | ||
* Call this method right before calling `server.shutdown()`. | ||
*/ | ||
terminate(): void; | ||
}; | ||
export declare function TerminatorMiddleware(): TerminatorMiddleware; |
{ | ||
"name": "nice-grpc-server-middleware-terminator", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"description": "Server middleware for nice-grpc to terminate long-running calls on shutdown", | ||
@@ -30,9 +30,9 @@ "repository": "deeplay-io/nice-grpc", | ||
"grpc-tools": "^1.10.0", | ||
"nice-grpc": "^2.1.3", | ||
"nice-grpc": "^2.1.4", | ||
"ts-proto": "^1.112.0" | ||
}, | ||
"dependencies": { | ||
"nice-grpc-common": "^2.0.1" | ||
"nice-grpc-common": "^2.0.2" | ||
}, | ||
"gitHead": "0e773a1697c7fdcacdf9a244f78e813577c8c8bd" | ||
"gitHead": "a2987f236be78513ea607faf691c9471d640bd0e" | ||
} |
@@ -10,6 +10,20 @@ import { | ||
export type TerminatorContext = { | ||
/** | ||
* Mark the call as one that should be aborted when the server is shutting | ||
* down. | ||
*/ | ||
abortOnTerminate(): void; | ||
}; | ||
/** | ||
* Server middleware that makes it possible to prevent long-running calls from | ||
* blocking server graceful shutdown. | ||
*/ | ||
export type TerminatorMiddleware = ServerMiddleware<TerminatorContext> & { | ||
/** | ||
* Aborts all calls that have called `abortOnTerminate` and make them return | ||
* gRPC errors with status `UNAVAILABLE`. | ||
* | ||
* Call this method right before calling `server.shutdown()`. | ||
*/ | ||
terminate(): void; | ||
@@ -16,0 +30,0 @@ }; |
Sorry, the diff of this file is not supported yet
11197
8.52%148
23.33%Updated