You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// To schedule a handler to be called at a later time, have a look at the documentation on [delayed calls][service_communication#delayed-calls].
219
+
/// To schedule a handler to be called at a later time, have a look at the documentation on [delayed calls][crate::context::ContextClient#delayed-calls].
/// **Note**: You can return any payload that implements the `serde::Serialize` and `serde::Deserialize` traits ([see serialization docs][serialization]).
612
+
/// **Note**: You can return any payload that implements the `serde::Serialize` and `serde::Deserialize` traits ([see serialization docs][crate::serde]).
613
613
///
614
614
/// **Note**: When running on Function-as-a-Service platforms, such as AWS Lambda, Restate suspends the handler while waiting for the awakeable to be completed.
615
615
/// Since you only pay for the time that the handler is actually running, you don't pay while waiting for the external process to return.
/// Restate uses an execution log for replay after failures and suspensions.
645
645
/// This means that non-deterministic results (e.g. database responses, UUID generation) need to be stored in the execution log.
646
646
/// The SDK offers some functionalities to help you with this:
647
-
/// 1. **[Journaled actions][journaling_results#journaled-actions]**: Run any block of code and store the result in Restate. Restate replays the result instead of re-executing the block on retries.
648
-
/// 3. **[Random generators][journaling_results#generating-randoms]**: Built-in helpers for generating stable UUIDs and random numbers.
647
+
/// 1. **[Journaled actions][crate::context::ContextSideEffects#journaled-actions]**: Run any block of code and store the result in Restate. Restate replays the result instead of re-executing the block on retries.
648
+
/// 3. **[Random generators][crate::context::ContextSideEffects#generating-randoms]**: Built-in helpers for generating stable UUIDs and random numbers.
649
649
///
650
650
/// ## Journaled actions
651
651
/// You can store the result of a (non-deterministic) operation in the Restate execution log (e.g. database requests, HTTP calls, etc).
/// Have a look at the [introspection docs](https://docs.restate.dev//operate/introspection#inspecting-application-state) for more information.
756
756
///
757
757
/// **Info: Serializing state**:
758
-
/// You can store any type of value that that implements the `serde::Serialize` and `serde::Deserialize` traits ([see serialization docs][serialization]).
758
+
/// You can store any type of value that that implements the `serde::Serialize` and `serde::Deserialize` traits ([see serialization docs][crate::serde]).
/// Have a look at the [introspection docs](https://docs.restate.dev//operate/introspection#inspecting-application-state) for more information.
819
819
///
820
820
/// **Info: Serializing state**:
821
-
/// You can store any type of value that that implements the `serde::Serialize` and `serde::Deserialize` traits ([see serialization docs][serialization]).
821
+
/// You can store any type of value that that implements the `serde::Serialize` and `serde::Deserialize` traits ([see serialization docs][crate::serde]).
Copy file name to clipboardExpand all lines: src/errors.rs
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@
15
15
//! # }
16
16
//! ```
17
17
//!
18
-
//! You can catch terminal exceptions. For example, you can catch the terminal exception that comes out of a [call to another service][service_communication#request-response-calls], and build your control flow around it.
18
+
//! You can catch terminal exceptions. For example, you can catch the terminal exception that comes out of a [call to another service][crate::context::ContextClient], and build your control flow around it.
//! Have a look at the following SDK capabilities:
45
+
//!
46
+
//! - [Service Communication][crate::context::ContextClient]: Durable RPC and messaging between services (optionally with a delay).
47
+
//! - [Journaling Results][crate::context::ContextSideEffects]: Persist results in Restate's log to avoid re-execution on retries
48
+
//! - State: [read][crate::context::ContextReadState] and [write](crate::context::ContextWriteState): Store and retrieve state in Restate's key-value store
49
+
//! - [Scheduling & Timers][crate::context::ContextTimers]: Let a handler pause for a certain amount of time. Restate durably tracks the timer across failures.
50
+
//! - [Awakeables][crate::context::ContextAwakeables]: Durable Futures to wait for events and the completion of external tasks.
51
+
//! - [Error Handling][crate::errors]: Restate retries failures infinitely. Use `TerminalError` to stop retries.
52
+
//! - [Serialization][crate::serde]: The SDK serializes results to send them to the Server.
53
+
//! - [Serving][crate::http_server]: Start an HTTP server to expose services.
51
54
//!
52
55
//!
53
56
//! # Logging
@@ -204,11 +207,11 @@ pub use restate_sdk_macros::object;
204
207
/// - Each workflow definition has a `run` handler that implements the workflow logic.
205
208
/// - The `run` handler executes exactly one time for each workflow instance (object / key).
206
209
/// - A workflow definition can implement other handlers that can be called multiple times, and can interact with the workflow.
207
-
/// - Workflows have access to the `WorkflowContext` and `SharedWorkflowContext`, giving them some extra functionality, for example [Durable Promises][workflows#signaling-workflows] to signal workflows.
210
+
/// - Workflows have access to the `WorkflowContext` and `SharedWorkflowContext`, giving them some extra functionality, for example Durable Promises to signal workflows.
208
211
///
209
212
/// **Note: Workflow retention time**:
210
213
/// The retention time of a workflow execution is 24 hours after the finishing of the `run` handler.
211
-
/// After this timeout any [K/V state][state] is cleared, the workflow's shared handlers cannot be called anymore, and the [Durable Promises][workflows#signaling-workflows] are discarded.
214
+
/// After this timeout any [K/V state][crate::context::ContextReadState] is cleared, the workflow's shared handlers cannot be called anymore, and the Durable Promises are discarded.
212
215
/// The retention time can be configured via the [Admin API](https://docs.restate.dev//references/admin-api/#tag/service/operation/modify_service) per Workflow definition by setting `workflow_completion_retention`.
213
216
///
214
217
/// ## Implementing workflows
@@ -265,7 +268,7 @@ pub use restate_sdk_macros::object;
265
268
///
266
269
/// Every workflow needs a `run` handler.
267
270
/// This handler has access to the same SDK features as Service and Virtual Object handlers.
268
-
/// In the example above, we use [`ctx.run`][journaling_results] to log the sending of the email in Restate and avoid re-execution on replay.
271
+
/// In the example above, we use [`ctx.run`][crate::context::ContextSideEffects] to log the sending of the email in Restate and avoid re-execution on replay.
269
272
///
270
273
///
271
274
/// ## Shared handlers
@@ -274,7 +277,7 @@ pub use restate_sdk_macros::object;
274
277
///
275
278
/// ### Querying workflows
276
279
///
277
-
/// Similar to Virtual Objects, you can retrieve the [K/V state][state] of workflows via the other handlers defined in the workflow definition,
280
+
/// Similar to Virtual Objects, you can retrieve the [K/V state][crate::context::ContextReadState] of workflows via the other handlers defined in the workflow definition,
278
281
/// In the example we expose the status of the workflow to external clients.
279
282
/// Every workflow execution can be seen as a new object, so the state is isolated to a single workflow execution.
280
283
/// The state can only be mutated by the `run` handler of the workflow. The other handlers can only read the state.
@@ -294,18 +297,18 @@ pub use restate_sdk_macros::object;
294
297
///
295
298
/// ### Serving and registering workflows
296
299
///
297
-
/// You serve workflows in the same way as Services and Virtual Objects. Have a look at the [Serving docs][serving].
300
+
/// You serve workflows in the same way as Services and Virtual Objects. Have a look at the [Serving docs][crate::http_server].
298
301
/// Make sure you [register the endpoint or Lambda handler](https://docs.restate.dev/operate/registration) in Restate before invoking it.
299
302
///
300
303
/// **Tip: Workflows-as-code with Restate**:
301
304
/// [Check out some examples of workflows-as-code with Restate on the use case page](https://docs.restate.dev/use-cases/workflows).
302
305
///
303
306
///
304
307
/// ## Submitting workflows from a Restate service
0 commit comments