@mark1russell7/service 0.5.11 → 0.5.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +110 -1
- package/build/{builder-Dn0cby6Q.d.ts → builder-DawJhq4p.d.ts} +2 -2
- package/build/core-BPLRDcUJ.d.ts +226 -0
- package/build/dial-DA8vJfh2.d.ts +16 -0
- package/build/grpc.d.ts +307 -0
- package/build/grpc.js +859 -0
- package/build/grpc.js.map +1 -0
- package/build/http-client.d.ts +248 -0
- package/build/http-client.js +612 -0
- package/build/http-client.js.map +1 -0
- package/build/http.d.ts +1 -1
- package/build/index.d.ts +8 -149
- package/build/index.js +155 -11
- package/build/index.js.map +1 -1
- package/build/{lifecycle-CGEegMI0.d.ts → lifecycle-fgYfxrHK.d.ts} +17 -2
- package/build/machine-BhTRu3u9.js +552 -0
- package/build/machine-BhTRu3u9.js.map +1 -0
- package/build/mongodb.d.ts +307 -0
- package/build/mongodb.js +688 -0
- package/build/mongodb.js.map +1 -0
- package/build/pg.d.ts +230 -0
- package/build/pg.js +531 -0
- package/build/pg.js.map +1 -0
- package/build/queue-snRHK3Jm.d.ts +150 -0
- package/build/rabbitmq.d.ts +294 -0
- package/build/rabbitmq.js +748 -0
- package/build/rabbitmq.js.map +1 -0
- package/build/redis.d.ts +24 -143
- package/build/redis.js +76 -315
- package/build/redis.js.map +1 -1
- package/build/testing.d.ts +2 -2
- package/build/websocket.d.ts +275 -0
- package/build/websocket.js +780 -0
- package/build/websocket.js.map +1 -0
- package/package.json +46 -1
package/build/grpc.d.ts
ADDED
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { Y as Poll, wt as Operation } from "./lifecycle-fgYfxrHK.js";
|
|
2
|
+
import { C as MANIFESTATIONS, D as firstDetector, E as Situation, O as unwatched, S as Detector, T as Meeting, _ as Sent, a as ClientKnobs, b as retryProblems, c as ClientSpec, d as Factory, f as ReadyWait, g as SendOptions, h as STARTING_POLL, i as ClientJoin, l as ClientStep, n as CheckOptions, o as ClientOptions, p as RetryKnobs, r as Client, s as ClientSocket, t as Attempt, u as DialFn, v as readyWait, w as Manifestation } from "./core-BPLRDcUJ.js";
|
|
3
|
+
import { t as Judge } from "./dial-DA8vJfh2.js";
|
|
4
|
+
import { Extent, Quantity } from "@mark1russell7/quantity";
|
|
5
|
+
import { Machine } from "@mark1russell7/algebra";
|
|
6
|
+
//#region src/grpc/connection.d.ts
|
|
7
|
+
/** A state is the connectivity state of a channel of grpc-js, by the names of its enum `connectivityState`. */
|
|
8
|
+
type GrpcState = "IDLE" | "CONNECTING" | "READY" | "TRANSIENT_FAILURE" | "SHUTDOWN";
|
|
9
|
+
/** These states are in the sequence of the enum of grpc-js: the index of a state is its value. */
|
|
10
|
+
export declare const GRPC_STATES: readonly GrpcState[];
|
|
11
|
+
/** A status is the end of one call: its code (0 is OK) and its details. */
|
|
12
|
+
interface GrpcStatus {
|
|
13
|
+
readonly code: number;
|
|
14
|
+
readonly details: string;
|
|
15
|
+
}
|
|
16
|
+
/** A call handle stops one call in flight. The grpc-js driver then writes RST_STREAM with the code CANCEL. */
|
|
17
|
+
interface GrpcCallHandle {
|
|
18
|
+
cancel(): void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A channel is the part of a `Client` of grpc-js 1.14 that the wrapper uses. A fake for tests has
|
|
22
|
+
* each part too. Thus the package depends on no type of grpc-js.
|
|
23
|
+
*/
|
|
24
|
+
interface GrpcChannel {
|
|
25
|
+
/** This method gives the state of the channel. True also starts a connect when the channel is IDLE. */
|
|
26
|
+
state(connect: boolean): GrpcState;
|
|
27
|
+
/** This method starts `changed` one time, when the state of the channel is no longer `current`. */
|
|
28
|
+
watch(current: GrpcState, changed: () => void): void;
|
|
29
|
+
/**
|
|
30
|
+
* This method sends one unary call: the method path and the bytes of its request message. `done`
|
|
31
|
+
* gets the status of the call, and the bytes of the response message when the status is OK. The
|
|
32
|
+
* call ends at `timeout` milliseconds with DEADLINE_EXCEEDED, and grpc-js sends the header `grpc-timeout`.
|
|
33
|
+
*/
|
|
34
|
+
unary(method: string, request: Buffer, metadata: Readonly<Record<string, string>>, timeout: number, done: (status: GrpcStatus, response: Buffer | undefined) => void): GrpcCallHandle;
|
|
35
|
+
/** This method closes the channel. Its state becomes SHUTDOWN, and it does not connect again. */
|
|
36
|
+
close(): void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* These are the options of the channel that the wrapper gives `new Client(target, credentials, options)`.
|
|
40
|
+
* Each time comes from the declaration, in milliseconds.
|
|
41
|
+
*/
|
|
42
|
+
interface GrpcChannelOptions {
|
|
43
|
+
/** The wrapper turns off the retries of grpc-js, the transparent retry too. Only the core decides a second send. */
|
|
44
|
+
readonly "grpc.enable_retries": 0;
|
|
45
|
+
/** The wrapper reads no service config from the resolver. Thus no record of DNS changes the policy of a call. */
|
|
46
|
+
readonly "grpc.service_config_disable_resolution": 1;
|
|
47
|
+
/** This time is the interval of the HTTP/2 PING of keepalive. Without it, grpc-js sends no PING. */
|
|
48
|
+
readonly "grpc.keepalive_time_ms"?: number | undefined;
|
|
49
|
+
/** This time bounds the ACK of each PING. Without an ACK in this time, grpc-js ends the transport. */
|
|
50
|
+
readonly "grpc.keepalive_timeout_ms": number;
|
|
51
|
+
/** 1 sends the PING with no call in flight too. The server must permit that, or it answers with GOAWAY too_many_pings (O26). */
|
|
52
|
+
readonly "grpc.keepalive_permit_without_calls": 0 | 1;
|
|
53
|
+
/** This time with no call puts the channel in IDLE, and closes its connection. */
|
|
54
|
+
readonly "grpc.client_idle_timeout_ms": number;
|
|
55
|
+
/** This time is the first delay of grpc-js before a new try to connect. */
|
|
56
|
+
readonly "grpc.initial_reconnect_backoff_ms": number;
|
|
57
|
+
/** This time is the most that one delay of grpc-js can be, before its jitter of 20 %. */
|
|
58
|
+
readonly "grpc.max_reconnect_backoff_ms": number;
|
|
59
|
+
}
|
|
60
|
+
/** These are the arguments of `new Client(target, credentials, options)`. The credentials are insecure: the client speaks h2c. */
|
|
61
|
+
interface GrpcConnectOptions {
|
|
62
|
+
readonly target: string;
|
|
63
|
+
readonly options: GrpcChannelOptions;
|
|
64
|
+
}
|
|
65
|
+
/** A channel factory makes one channel from its options. The channel connects later, when the wrapper asks it. */
|
|
66
|
+
type GrpcFactory = Factory<GrpcConnectOptions, GrpcChannel>;
|
|
67
|
+
/** This type is the part of a `Client` of grpc-js 1.14 that the adapter uses. */
|
|
68
|
+
interface GrpcDriverClient {
|
|
69
|
+
getChannel(): {
|
|
70
|
+
getConnectivityState(connect: boolean): number;
|
|
71
|
+
watchConnectivityState(current: number, deadline: number, callback: (error?: Error) => void): void;
|
|
72
|
+
};
|
|
73
|
+
makeUnaryRequest(method: string, serialize: (value: Buffer) => Buffer, deserialize: (bytes: Buffer) => Buffer, argument: Buffer, metadata: unknown, options: {
|
|
74
|
+
readonly deadline: number;
|
|
75
|
+
}, callback: (error: {
|
|
76
|
+
readonly code?: number;
|
|
77
|
+
readonly details?: string;
|
|
78
|
+
readonly message?: string;
|
|
79
|
+
} | null, value?: Buffer) => void): GrpcCallHandle;
|
|
80
|
+
close(): void;
|
|
81
|
+
}
|
|
82
|
+
/** This type is the part of the module of grpc-js that the adapter uses. */
|
|
83
|
+
interface GrpcDriver {
|
|
84
|
+
readonly Client: new (target: string, credentials: unknown, options: GrpcChannelOptions) => GrpcDriverClient;
|
|
85
|
+
readonly credentials: {
|
|
86
|
+
createInsecure(): unknown;
|
|
87
|
+
};
|
|
88
|
+
readonly Metadata: new () => {
|
|
89
|
+
add(key: string, value: string): void;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* This function adapts a `Client` of grpc-js to a channel. The deadline of grpc-js is a time of the
|
|
94
|
+
* wall clock, thus the adapter adds the timeout to `Date.now()`.
|
|
95
|
+
*/
|
|
96
|
+
export declare const adaptGrpc: (grpc: GrpcDriver, client: GrpcDriverClient) => GrpcChannel;
|
|
97
|
+
/**
|
|
98
|
+
* This factory makes a `Client` of grpc-js. It loads grpc-js only when a client connects, thus a
|
|
99
|
+
* service that does not use gRPC does not need it. The specifier is a value, thus the package needs no types of grpc-js.
|
|
100
|
+
*/
|
|
101
|
+
export declare const nodeGrpc: GrpcFactory;
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/grpc/client.d.ts
|
|
104
|
+
/**
|
|
105
|
+
* These are the knobs of the client, each a time, by the names of the ordering law and of the gRPC
|
|
106
|
+
* cells. The runtime has no defaults, thus each knob is necessary. The constant
|
|
107
|
+
* `GRPC_CLIENT_STARTING_KNOBS` gives a declaration from the gRPC cells. The knobs that each client has come from the core.
|
|
108
|
+
*/
|
|
109
|
+
interface GrpcKnobs extends ClientKnobs, RetryKnobs {
|
|
110
|
+
/** This time bounds the wait of the startup for a ready channel. The grpc-js driver has no connect timeout, and the wrapper cannot stop one connect. */
|
|
111
|
+
readonly connect_bound: Quantity;
|
|
112
|
+
/** This time is the deadline of each call, from its start. A second try ends in the same bound. The grpc-js driver sends it as `grpc-timeout`. */
|
|
113
|
+
readonly request_timeout: Quantity;
|
|
114
|
+
/** This time is the interval of the HTTP/2 PING of keepalive (`grpc.keepalive_time_ms`). "infinite" sends no PING, as grpc-js does at its defaults. */
|
|
115
|
+
readonly keepalive_time: Extent;
|
|
116
|
+
/** This time bounds the ACK of each PING (`grpc.keepalive_timeout_ms`). With no ACK, grpc-js ends the transport. */
|
|
117
|
+
readonly keepalive_timeout: Quantity;
|
|
118
|
+
/** This time with no call puts the channel in IDLE and closes its connection (`grpc.client_idle_timeout_ms`). The client then connects again. */
|
|
119
|
+
readonly client_idle_timeout: Quantity;
|
|
120
|
+
/**
|
|
121
|
+
* This time is the shortest interval of the PING that the server permits: `MinTime` of the
|
|
122
|
+
* enforcement policy of grpc-go. A shorter keepalive gets GOAWAY too_many_pings (O26). It is a fact of the server, not a knob of the client.
|
|
123
|
+
*/
|
|
124
|
+
readonly server_keepalive_min_time: Quantity;
|
|
125
|
+
/** This time is when the server or a proxy ends an idle connection with GOAWAY, or "infinite". The client must close first (O01). */
|
|
126
|
+
readonly server_idle_close: Extent;
|
|
127
|
+
/** This time is the first delay of grpc-js before a new try to connect (`grpc.initial_reconnect_backoff_ms`). */
|
|
128
|
+
readonly retry_base: Quantity;
|
|
129
|
+
/** This time is the most that one delay of grpc-js can be, before its jitter of 20 % (`grpc.max_reconnect_backoff_ms`). */
|
|
130
|
+
readonly retry_cap: Quantity;
|
|
131
|
+
/** The grpc-js driver sets no TCP keepalive on its socket: the PING of `keepalive_time` is its keepalive. Thus this knob must be "infinite". */
|
|
132
|
+
readonly keepalive_idle: Extent;
|
|
133
|
+
/** The client does not replace its connection at an age, thus this knob must be "infinite". */
|
|
134
|
+
readonly max_connection_age: Extent;
|
|
135
|
+
/** This time bounds the close at the shutdown: the calls in flight. At the bound, the client cancels each call, then closes the channel. */
|
|
136
|
+
readonly close_bound: Quantity;
|
|
137
|
+
}
|
|
138
|
+
/** A gRPC client spec is the declaration of one gRPC client: where it connects, and its knobs. */
|
|
139
|
+
interface GrpcClientSpec extends ClientSpec<GrpcKnobs> {
|
|
140
|
+
/**
|
|
141
|
+
* True sends the PING of keepalive with no call in flight too (`grpc.keepalive_permit_without_calls`).
|
|
142
|
+
* The server must permit that (`PermitWithoutStream` of grpc-go), or it answers with GOAWAY too_many_pings (O26).
|
|
143
|
+
*/
|
|
144
|
+
readonly keepaliveWithoutCalls: boolean;
|
|
145
|
+
/** These headers go with each call, for example `authorization`. The metadata of a call adds to them. */
|
|
146
|
+
readonly metadata?: Readonly<Record<string, string>> | undefined;
|
|
147
|
+
/** This name is the service that the round-trip check asks the health service about. The default is "", the whole server. */
|
|
148
|
+
readonly healthService?: string | undefined;
|
|
149
|
+
/**
|
|
150
|
+
* These operations are the methods of the service, by their full path, with their idempotency. The
|
|
151
|
+
* client sends again only a method that this table names as idempotent. `grpcOperations` makes the
|
|
152
|
+
* table from the `idempotency_level` of each method in its proto.
|
|
153
|
+
*/
|
|
154
|
+
readonly operations?: ClientSpec<GrpcKnobs>["operations"];
|
|
155
|
+
}
|
|
156
|
+
/** These options make a client. Without them, it uses grpc-js, the real clock, and a dial with the HTTP/2 preface. */
|
|
157
|
+
type GrpcClientOptions = ClientOptions<GrpcFactory>;
|
|
158
|
+
/**
|
|
159
|
+
* A join is one generation of the client: each time that its channel becomes READY (D1, D2). The
|
|
160
|
+
* grpc-js driver gives no socket of its transport, thus the ends of the socket are null.
|
|
161
|
+
*/
|
|
162
|
+
interface GrpcJoin extends ClientJoin {
|
|
163
|
+
/** This text is the target of the channel. */
|
|
164
|
+
readonly target: string;
|
|
165
|
+
}
|
|
166
|
+
/** These options tell how the client sends one call. */
|
|
167
|
+
interface GrpcCallOptions extends SendOptions {
|
|
168
|
+
/** These headers go with this call, after the metadata of the spec. */
|
|
169
|
+
readonly metadata?: Readonly<Record<string, string>> | undefined;
|
|
170
|
+
}
|
|
171
|
+
/** A serving status is the status of a HealthCheckResponse of the health service (grpc.health.v1). */
|
|
172
|
+
type GrpcServingStatus = "UNKNOWN" | "SERVING" | "NOT_SERVING" | "SERVICE_UNKNOWN";
|
|
173
|
+
/** A gRPC client is a dependency of a service: its declaration, its handle, its checks and its calls. */
|
|
174
|
+
interface GrpcClient extends Client<ClientStep, GrpcJoin> {
|
|
175
|
+
/** This text is the state of the client, as `GRPC_CLIENT_MACHINE` names it. */
|
|
176
|
+
readonly status: string;
|
|
177
|
+
/**
|
|
178
|
+
* This method sends one unary call, and waits for its status. `request` holds the bytes of the
|
|
179
|
+
* request message, and an OK status gives the bytes of the response message. The client sends again
|
|
180
|
+
* only an idempotent method, one time at most, after an outcome that is not certain.
|
|
181
|
+
*/
|
|
182
|
+
call(method: string, request: Buffer, options?: GrpcCallOptions): Promise<Sent<Buffer>>;
|
|
183
|
+
/** This method sends one Check of the health service (grpc.health.v1), and gives the serving status of the reply. */
|
|
184
|
+
health(service?: string, options?: SendOptions): Promise<Sent<GrpcServingStatus>>;
|
|
185
|
+
}
|
|
186
|
+
/** The names of the status codes of gRPC, by their value. */
|
|
187
|
+
export declare const GRPC_CODES: readonly ["OK", "CANCELLED", "UNKNOWN", "INVALID_ARGUMENT", "DEADLINE_EXCEEDED", "NOT_FOUND", "ALREADY_EXISTS", "PERMISSION_DENIED", "RESOURCE_EXHAUSTED", "FAILED_PRECONDITION", "ABORTED", "OUT_OF_RANGE", "UNIMPLEMENTED", "INTERNAL", "UNAVAILABLE", "DATA_LOSS", "UNAUTHENTICATED"];
|
|
188
|
+
/** This function gives the name of a status code, for example "UNAVAILABLE". */
|
|
189
|
+
export declare const codeName: (code: number) => string;
|
|
190
|
+
/**
|
|
191
|
+
* This function gives the outcome of one call from its status:
|
|
192
|
+
* - OK is `ok`.
|
|
193
|
+
* - A code that tells that the server refused the call is a certain error: `reply` is true.
|
|
194
|
+
* - A status that tells that the call did not leave the client is a certain error with `reply` false.
|
|
195
|
+
* - Each other status is indeterminate: CANCELLED, UNKNOWN, DEADLINE_EXCEEDED, RESOURCE_EXHAUSTED,
|
|
196
|
+
* INTERNAL, UNAVAILABLE and DATA_LOSS can come after the server applied the call.
|
|
197
|
+
*/
|
|
198
|
+
export declare const grpcOutcome: (status: GrpcStatus, response: Buffer | undefined) => Attempt<Buffer>;
|
|
199
|
+
/** This method is the Check of the health service. Its request names a service, and its response gives a serving status. */
|
|
200
|
+
export declare const HEALTH_CHECK = "/grpc.health.v1.Health/Check";
|
|
201
|
+
/** These operations are in each table: the Check of the health service has no side effects. */
|
|
202
|
+
export declare const GRPC_OPERATIONS: Readonly<Record<string, Operation>>;
|
|
203
|
+
/** An idempotency level is the option `idempotency_level` of a method in its proto (descriptor.proto). */
|
|
204
|
+
type GrpcIdempotencyLevel = "IDEMPOTENCY_UNKNOWN" | "NO_SIDE_EFFECTS" | "IDEMPOTENT";
|
|
205
|
+
/**
|
|
206
|
+
* This function makes a table of operations from the idempotency level of each method, by its full
|
|
207
|
+
* path. NO_SIDE_EFFECTS and IDEMPOTENT are idempotent. IDEMPOTENCY_UNKNOWN, the default of a proto, is not.
|
|
208
|
+
*/
|
|
209
|
+
export declare const grpcOperations: (levels: Readonly<Record<string, GrpcIdempotencyLevel>>) => Record<string, Operation>;
|
|
210
|
+
/** This function gives the bytes of a HealthCheckRequest. The service "" is the whole server, and its message is empty. */
|
|
211
|
+
export declare const healthRequest: (service: string) => Buffer;
|
|
212
|
+
/** This function gives the status of a HealthCheckResponse, or null when the bytes are not one. An empty message is UNKNOWN. */
|
|
213
|
+
export declare const healthStatus: (bytes: Buffer) => GrpcServingStatus | null;
|
|
214
|
+
/** This function gives the problems of a spec: the knobs that the client cannot use. */
|
|
215
|
+
export declare const specProblems: (name: string, spec: GrpcClientSpec) => string[];
|
|
216
|
+
/** This function gives the target of a channel from a spec: the host and the port, for the DNS resolver of grpc-js. */
|
|
217
|
+
export declare const grpcTarget: (spec: Pick<GrpcClientSpec, "host" | "port">) => string;
|
|
218
|
+
/**
|
|
219
|
+
* This function gives the arguments of `new Client` from a spec. Each timer of grpc-js comes from the
|
|
220
|
+
* declaration. The retries of grpc-js are off, and the resolver gives no service config.
|
|
221
|
+
*/
|
|
222
|
+
export declare const grpcOptions: (spec: GrpcClientSpec) => GrpcConnectOptions;
|
|
223
|
+
/** These are the bytes of the dial: the connection preface of the client (RFC 9113 §3.4), and a SETTINGS frame with no setting. */
|
|
224
|
+
export declare const HTTP2_PREFACE: Buffer;
|
|
225
|
+
/**
|
|
226
|
+
* This judge reads the first frame of the server. Only a SETTINGS frame on stream 0, with no ACK,
|
|
227
|
+
* passes: RFC 9113 §3.4 makes it the first frame of an HTTP/2 server. An HTTP/1.1 server answers with a status line.
|
|
228
|
+
*/
|
|
229
|
+
export declare const settingsJudge: Judge;
|
|
230
|
+
/** This dial opens a new TCP connection, sends the HTTP/2 preface, and waits for the SETTINGS frame of the server. The dial then destroys its socket. */
|
|
231
|
+
export declare const grpcDial: DialFn;
|
|
232
|
+
/**
|
|
233
|
+
* This function makes a gRPC client, a dependency of a service over grpc-js 1.14.
|
|
234
|
+
* - It has one channel for its life. Each time that the channel becomes READY is one generation.
|
|
235
|
+
* - The grpc-js driver connects again by itself, after its own backoff. The client connects an IDLE channel again at once.
|
|
236
|
+
* - A call is one unary call, until its status. Its deadline is the time that is left in `request_timeout`.
|
|
237
|
+
* - It tells the outcome of a call in three values from its status code (C8).
|
|
238
|
+
* - The retries of grpc-js are off, thus only the core sends a call again.
|
|
239
|
+
* - Its keepalive is the HTTP/2 PING of grpc-js. It records the target of each generation (D1).
|
|
240
|
+
*
|
|
241
|
+
* These parts come from the core of the clients: the outcomes, the second try and the wait for a ready client.
|
|
242
|
+
* The calls in flight, the bounded close and the checks come from the core too. This entry gives what grpc-js does in its own way.
|
|
243
|
+
*/
|
|
244
|
+
export declare const grpcClient: (name: string, spec: GrpcClientSpec, options?: GrpcClientOptions) => GrpcClient;
|
|
245
|
+
//#endregion
|
|
246
|
+
//#region src/grpc/machine.d.ts
|
|
247
|
+
/**
|
|
248
|
+
* The gRPC client of the service as a `mark1russell7.machine/1` document. It is one channel of
|
|
249
|
+
* grpc-js 1.14 for the life of the client. Each READY of the channel is one generation. The states:
|
|
250
|
+
* - `ready`: the channel is READY, and the client sends each call. The keepalive sends a PING each keepalive_time.
|
|
251
|
+
* - `idle`: the transport ended, or the channel had no call in client_idle_timeout. The client connects again at once.
|
|
252
|
+
* - `failing`: the channel is in TRANSIENT_FAILURE. The grpc-js driver connects again after its backoff.
|
|
253
|
+
* - `closing`: the calls in flight, in `close_bound`. At the bound, each call gets RST_STREAM CANCEL.
|
|
254
|
+
*
|
|
255
|
+
* A test records the transitions of the client and replays them against this document.
|
|
256
|
+
*/
|
|
257
|
+
export declare const GRPC_CLIENT_MACHINE: Machine;
|
|
258
|
+
//#endregion
|
|
259
|
+
//#region src/grpc/meets.d.ts
|
|
260
|
+
/**
|
|
261
|
+
* This function gives the manifestations that a gRPC client can meet, and the detectors of each,
|
|
262
|
+
* from its knobs. The gRPC cells measured them on grpc-js 1.14.6:
|
|
263
|
+
* - At its defaults, grpc-js has no detector: no keepalive, no deadline, and no TCP keepalive.
|
|
264
|
+
* - A reset gave each call ECONNRESET in 1.1 ms to 1.4 ms. The FIN of a stopped server ended an idle connection in 43 µs.
|
|
265
|
+
* - The keepalive ended a silent transport at keepalive_time + keepalive_timeout: 80.012 s at 60 s
|
|
266
|
+
* against etcd, and 320.005 s at 300 s against grpc-go (DP24).
|
|
267
|
+
* - Without `keepaliveWithoutCalls`, grpc-js sends a PING only with a call in flight.
|
|
268
|
+
* - At client_idle_timeout, the channel goes IDLE, and the client connects again. A server that does
|
|
269
|
+
* not answer then keeps the channel out of READY.
|
|
270
|
+
*/
|
|
271
|
+
export declare const grpcMeetings: (name: string, knobs: GrpcKnobs, withoutCalls: boolean) => Meeting[];
|
|
272
|
+
//#endregion
|
|
273
|
+
//#region src/grpc/starting.d.ts
|
|
274
|
+
/**
|
|
275
|
+
* This poll is the poll of the checks that `GRPC_CLIENT_STARTING_KNOBS` fits. It is `STARTING_POLL` of
|
|
276
|
+
* the core: each 5 s with a jitter of 20 %, and a timeout of 4 s (B6, O12). The poll does not depend on the driver.
|
|
277
|
+
*/
|
|
278
|
+
export declare const GRPC_CLIENT_STARTING_POLL: Poll;
|
|
279
|
+
/**
|
|
280
|
+
* This value tells if the keepalive sends a PING with no call in flight, to start from: false. The
|
|
281
|
+
* grpc-go server refuses such a PING at its defaults (`PermitWithoutStream` false). It answers with GOAWAY too_many_pings (O26).
|
|
282
|
+
*/
|
|
283
|
+
export declare const GRPC_CLIENT_STARTING_WITHOUT_CALLS: boolean;
|
|
284
|
+
/**
|
|
285
|
+
* These knobs are a declaration to start from, from what the gRPC cells measured on grpc-js 1.14.6.
|
|
286
|
+
* The runtime has no defaults: a service gives these knobs, or its own. Each value holds the borders that the cells measured:
|
|
287
|
+
* - `connect_bound` 5 s: the connect timeout of DP44. The grpc-js driver has no connect timeout, thus this bounds the wait of the startup.
|
|
288
|
+
* - `request_timeout` 9.5 s: in the slowest poll of 10 s (O13). In DP44 a deadline of 4 s ended each
|
|
289
|
+
* call at 4.003 s to 4.004 s. The race of the two deadlines gave CANCELLED to 2 to 4 calls of 11.
|
|
290
|
+
* - `keepalive_time` 300 s and `keepalive_timeout` 20 s: DP24. The PING must not come before the
|
|
291
|
+
* `MinTime` of the server, 5 min at the defaults of grpc-go (O26). The transport ended at 320.005 s.
|
|
292
|
+
* Against etcd, with a `MinTime` of 5 s, 60 s ended it at 80.012 s. A PING each 4 s against 5 s got GOAWAY at the 4th PING.
|
|
293
|
+
* - `server_keepalive_min_time` 300 s: the `MinTime` of grpc-go v1.84.0 at its defaults.
|
|
294
|
+
* - `client_idle_timeout` 60 s and `server_idle_close` 75 s: the proxies of the cells sent GOAWAY to an idle connection.
|
|
295
|
+
* They did that at 75 s (nginx), 180 s (Traefik), 300 s (Caddy) and 1 h (Envoy). The client closes first (O01).
|
|
296
|
+
* The default of grpc-js is 30 min.
|
|
297
|
+
* - `retry_base` 1 s: the first backoff of grpc-js in T07, with no jitter. `retry_cap` 4 s: the most
|
|
298
|
+
* delay is 4.8 s with the jitter of 20 %, in the slowest poll of 10 s. The default of grpc-js is 120 s.
|
|
299
|
+
* - `keepalive_idle` "infinite": grpc-js sets no TCP keepalive, and the PING is its keepalive.
|
|
300
|
+
* - `max_connection_age` "infinite": the client does not replace its connection at an age.
|
|
301
|
+
* - `close_bound` 2 s: the calls in flight, then RST_STREAM CANCEL for each call that stays.
|
|
302
|
+
* - `retrans_giveup_time` 924.6 s: the give-up of Linux at `tcp_retries2 = 15`.
|
|
303
|
+
*/
|
|
304
|
+
export declare const GRPC_CLIENT_STARTING_KNOBS: GrpcKnobs;
|
|
305
|
+
//#endregion
|
|
306
|
+
export { type Attempt, type CheckOptions, type Client, type ClientJoin, type ClientKnobs, type ClientOptions, type ClientSocket, type ClientSpec, type ClientStep, type Detector, type DialFn, type Factory, type GrpcCallHandle, type GrpcCallOptions, type GrpcChannel, type GrpcChannelOptions, type GrpcClient, type GrpcClientOptions, type GrpcClientSpec, type GrpcConnectOptions, type GrpcFactory, type GrpcIdempotencyLevel, type GrpcJoin, type GrpcKnobs, type GrpcServingStatus, type GrpcState, type GrpcStatus, type Judge, MANIFESTATIONS, type Manifestation, type Meeting, type ReadyWait, type RetryKnobs, STARTING_POLL, type SendOptions, type Sent, type Situation, firstDetector, readyWait, retryProblems, unwatched };
|
|
307
|
+
//# sourceMappingURL=grpc.d.ts.map
|