Skip to content

Commit 411be14

Browse files
authored
Fix typos in in-code docs (#163)
1 parent 75961af commit 411be14

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

src/restate_context.ts

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ export interface RestateBaseContext {
8181
* - If a side effect executed and persisted before, the result (value or Error) will be
8282
* taken from the Restate journal.
8383
* - 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
8686
* 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
8888
* re-executed on replay (the latest, if the failure happened in the small windows
8989
* described above).
9090
*
9191
* 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
9393
* backoff and uses suspending sleep for the wait times between retries.
9494
*
9595
* @example
@@ -108,7 +108,7 @@ export interface RestateBaseContext {
108108
* const paymentAccepted: boolean =
109109
* await ctx.sideEffect(paymentAction, { maxRetries: 10});
110110
*
111-
* @param fn The funcion to run as a side-effect.
111+
* @param fn The function to run as a side effect.
112112
* @param retryPolicy The optional policy describing how retries happen.
113113
*/
114114
sideEffect<T>(fn: () => Promise<T>, retryPolicy?: RetrySettings): Promise<T>;
@@ -180,10 +180,10 @@ export interface RestateBaseContext {
180180
// ----------------------------------------------------------------------------
181181

182182
/**
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
184184
* - sending reliable messages / rpc through Restate
185185
* - access/update state (for keyed services)
186-
* - side-effects
186+
* - side effects
187187
* - sleeps and delayed calls
188188
* - awakeables
189189
* - ...
@@ -305,11 +305,11 @@ export function setContext<T>(instance: T, context: RestateGrpcContext): T {
305305
* **Service Side:**
306306
* ```ts
307307
* 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) => { ... }
310310
* });
311311
*
312-
* export const myApi: ServiceApi<typeof router> = { path : "myservice" };
312+
* export const myApi: restate.ServiceApi<typeof router> = { path : "myservice" };
313313
*
314314
* restate.createServer().bindRouter("myservice", router).listen(8080);
315315
* ```
@@ -323,10 +323,10 @@ export type ServiceApi<_M = unknown> = {
323323
};
324324

325325
/**
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
328328
* - access/update state (for keyed services)
329-
* - side-effects
329+
* - side effects
330330
* - sleeps and delayed calls
331331
* - awakeables
332332
* - ...
@@ -336,7 +336,7 @@ export type ServiceApi<_M = unknown> = {
336336
*/
337337
export interface RpcContext extends RestateBaseContext {
338338
/**
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.
340340
*
341341
* The RPC goes through Restate and is guaranteed to be reliably delivered. The RPC is also
342342
* 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 {
345345
* This call will return the result produced by the target handler, or the Error, if the target
346346
* handler finishes with a Terminal Error.
347347
*
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
349349
* resume once the response is available.
350350
*
351351
* @example
352352
* *Service Side:*
353353
* ```ts
354354
* 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) => { ... }
357357
* });
358358
*
359359
* // option 1: export only the type signature of the router
360360
* export type myApiType = typeof router;
361361
*
362362
* // 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" };
364364
*
365365
* restate.createServer().bindRouter("myservice", router).listen(8080);
366366
* ```
@@ -393,15 +393,15 @@ export interface RpcContext extends RestateBaseContext {
393393
* *Service Side:*
394394
* ```ts
395395
* 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) => { ... }
398398
* });
399399
*
400400
* // option 1: export only the type signature of the router
401401
* export type myApiType = typeof router;
402402
*
403403
* // 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" };
405405
*
406406
* restate.createServer().bindRouter("myservice", router).listen(8080);
407407
* ```
@@ -418,7 +418,7 @@ export interface RpcContext extends RestateBaseContext {
418418

419419
/**
420420
* Makes a type-safe one-way RPC to the specified target service, after a delay specified by the
421-
* milliseconds argument.
421+
* milliseconds' argument.
422422
* This method is like stetting up a fault-tolerant cron job that enqueues the message in a
423423
* message queue.
424424
* The handler calling this function does not have to stay active for the delay time.
@@ -440,25 +440,25 @@ export interface RpcContext extends RestateBaseContext {
440440
* *Service Side:*
441441
* ```ts
442442
* 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) => { ... }
445445
* });
446446
*
447447
* // option 1: export only the type signature of the router
448448
* export type myApiType = typeof router;
449449
*
450450
* // 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" };
452452
*
453453
* restate.createServer().bindRouter("myservice", router).listen(8080);
454454
* ```
455455
* **Client side:**
456456
* ```ts
457457
* // 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!");
459459
*
460460
* // option 2: use full API spec
461-
* ctx.send(myApi, 60_000).anotherAction(1337);
461+
* ctx.sendDelayed(myApi, 60_000).anotherAction(1337);
462462
* ```
463463
*/
464464
sendDelayed<M>(opts: ServiceApi<M>, delay: number): SendClient<M>;

0 commit comments

Comments
 (0)