@@ -81,15 +81,15 @@ export interface RestateBaseContext {
81
81
* - If a side effect executed and persisted before, the result (value or Error) will be
82
82
* taken from the Restate journal.
83
83
* - There is a small window where a side effect may be re-executed twice, if a failure
84
- * occured between execution and persisting the result.
85
- * - No second side- effect will be executed while a previous side- effect's result is not
84
+ * occurred between execution and persisting the result.
85
+ * - No second side effect will be executed while a previous side effect's result is not
86
86
* yet durable. That way, side effects that build on top of each other can assume
87
- * deterministic results from previous effects, and at most one side- effect will be
87
+ * deterministic results from previous effects, and at most one side effect will be
88
88
* re-executed on replay (the latest, if the failure happened in the small windows
89
89
* described above).
90
90
*
91
91
* This function takes an optional retry policy, that determines what happens if the
92
- * side- effect throws an error. The default retry policy retries infinitely, with exponential
92
+ * side effect throws an error. The default retry policy retries infinitely, with exponential
93
93
* backoff and uses suspending sleep for the wait times between retries.
94
94
*
95
95
* @example
@@ -108,7 +108,7 @@ export interface RestateBaseContext {
108
108
* const paymentAccepted: boolean =
109
109
* await ctx.sideEffect(paymentAction, { maxRetries: 10});
110
110
*
111
- * @param fn The funcion to run as a side- effect.
111
+ * @param fn The function to run as a side effect.
112
112
* @param retryPolicy The optional policy describing how retries happen.
113
113
*/
114
114
sideEffect < T > ( fn : ( ) => Promise < T > , retryPolicy ?: RetrySettings ) : Promise < T > ;
@@ -180,10 +180,10 @@ export interface RestateBaseContext {
180
180
// ----------------------------------------------------------------------------
181
181
182
182
/**
183
- * The context that gives access to all Restate-backed operstions , for example
183
+ * The context that gives access to all Restate-backed operations , for example
184
184
* - sending reliable messages / rpc through Restate
185
185
* - access/update state (for keyed services)
186
- * - side- effects
186
+ * - side effects
187
187
* - sleeps and delayed calls
188
188
* - awakeables
189
189
* - ...
@@ -305,11 +305,11 @@ export function setContext<T>(instance: T, context: RestateGrpcContext): T {
305
305
* **Service Side:**
306
306
* ```ts
307
307
* const router = restate.router({
308
- * someAction: async(ctx: RpcContext, req: string) => { ... },
309
- * anotherAction: async(ctx: RpcContext, count: number) => { ... }
308
+ * someAction: async(ctx: restate. RpcContext, req: string) => { ... },
309
+ * anotherAction: async(ctx: restate. RpcContext, count: number) => { ... }
310
310
* });
311
311
*
312
- * export const myApi: ServiceApi<typeof router> = { path : "myservice" };
312
+ * export const myApi: restate. ServiceApi<typeof router> = { path : "myservice" };
313
313
*
314
314
* restate.createServer().bindRouter("myservice", router).listen(8080);
315
315
* ```
@@ -323,10 +323,10 @@ export type ServiceApi<_M = unknown> = {
323
323
} ;
324
324
325
325
/**
326
- * The context that gives access to all Restate-backed operstions , for example
327
- * - sending reliable messages / rpc through Restate
326
+ * The context that gives access to all Restate-backed operations , for example
327
+ * - sending reliable messages / RPC through Restate
328
328
* - access/update state (for keyed services)
329
- * - side- effects
329
+ * - side effects
330
330
* - sleeps and delayed calls
331
331
* - awakeables
332
332
* - ...
@@ -336,7 +336,7 @@ export type ServiceApi<_M = unknown> = {
336
336
*/
337
337
export interface RpcContext extends RestateBaseContext {
338
338
/**
339
- * Makes a type-safe request/reponse RPC to the specified target service.
339
+ * Makes a type-safe request/response RPC to the specified target service.
340
340
*
341
341
* The RPC goes through Restate and is guaranteed to be reliably delivered. The RPC is also
342
342
* journaled for durable execution and will thus not be duplicated when the handler is re-invoked
@@ -345,22 +345,22 @@ export interface RpcContext extends RestateBaseContext {
345
345
* This call will return the result produced by the target handler, or the Error, if the target
346
346
* handler finishes with a Terminal Error.
347
347
*
348
- * This call is a suspension point: The hander might suspend while awaiting the response and
348
+ * This call is a suspension point: The handler might suspend while awaiting the response and
349
349
* resume once the response is available.
350
350
*
351
351
* @example
352
352
* *Service Side:*
353
353
* ```ts
354
354
* const router = restate.router({
355
- * someAction: async(ctx: RpcContext, req: string) => { ... },
356
- * anotherAction: async(ctx: RpcContext, count: number) => { ... }
355
+ * someAction: async(ctx: restate. RpcContext, req: string) => { ... },
356
+ * anotherAction: async(ctx: restate. RpcContext, count: number) => { ... }
357
357
* });
358
358
*
359
359
* // option 1: export only the type signature of the router
360
360
* export type myApiType = typeof router;
361
361
*
362
362
* // option 2: export the API definition with type and name (path)
363
- * export const myApi: ServiceApi<typeof router> = { path : "myservice" };
363
+ * export const myApi: restate. ServiceApi<typeof router> = { path : "myservice" };
364
364
*
365
365
* restate.createServer().bindRouter("myservice", router).listen(8080);
366
366
* ```
@@ -393,15 +393,15 @@ export interface RpcContext extends RestateBaseContext {
393
393
* *Service Side:*
394
394
* ```ts
395
395
* const router = restate.router({
396
- * someAction: async(ctx: RpcContext, req: string) => { ... },
397
- * anotherAction: async(ctx: RpcContext, count: number) => { ... }
396
+ * someAction: async(ctx: restate. RpcContext, req: string) => { ... },
397
+ * anotherAction: async(ctx: restate. RpcContext, count: number) => { ... }
398
398
* });
399
399
*
400
400
* // option 1: export only the type signature of the router
401
401
* export type myApiType = typeof router;
402
402
*
403
403
* // option 2: export the API definition with type and name (path)
404
- * export const myApi: ServiceApi<typeof router> = { path : "myservice" };
404
+ * export const myApi: restate. ServiceApi<typeof router> = { path : "myservice" };
405
405
*
406
406
* restate.createServer().bindRouter("myservice", router).listen(8080);
407
407
* ```
@@ -418,7 +418,7 @@ export interface RpcContext extends RestateBaseContext {
418
418
419
419
/**
420
420
* Makes a type-safe one-way RPC to the specified target service, after a delay specified by the
421
- * milliseconds argument.
421
+ * milliseconds' argument.
422
422
* This method is like stetting up a fault-tolerant cron job that enqueues the message in a
423
423
* message queue.
424
424
* The handler calling this function does not have to stay active for the delay time.
@@ -440,25 +440,25 @@ export interface RpcContext extends RestateBaseContext {
440
440
* *Service Side:*
441
441
* ```ts
442
442
* const router = restate.router({
443
- * someAction: async(ctx: RpcContext, req: string) => { ... },
444
- * anotherAction: async(ctx: RpcContext, count: number) => { ... }
443
+ * someAction: async(ctx: restate. RpcContext, req: string) => { ... },
444
+ * anotherAction: async(ctx: restate. RpcContext, count: number) => { ... }
445
445
* });
446
446
*
447
447
* // option 1: export only the type signature of the router
448
448
* export type myApiType = typeof router;
449
449
*
450
450
* // option 2: export the API definition with type and name (path)
451
- * export const myApi: ServiceApi<typeof router> = { path : "myservice" };
451
+ * export const myApi: restate. ServiceApi<typeof router> = { path : "myservice" };
452
452
*
453
453
* restate.createServer().bindRouter("myservice", router).listen(8080);
454
454
* ```
455
455
* **Client side:**
456
456
* ```ts
457
457
* // option 1: use only types and supply service name separately
458
- * ctx.send <myApiType>({path: "myservice"}, 60_000).someAction("hello!");
458
+ * ctx.sendDelayed <myApiType>({path: "myservice"}, 60_000).someAction("hello!");
459
459
*
460
460
* // option 2: use full API spec
461
- * ctx.send (myApi, 60_000).anotherAction(1337);
461
+ * ctx.sendDelayed (myApi, 60_000).anotherAction(1337);
462
462
* ```
463
463
*/
464
464
sendDelayed < M > ( opts : ServiceApi < M > , delay : number ) : SendClient < M > ;
0 commit comments