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
As an aside, you'll also notice that the example orchestration above works with custom business objects. Support for custom business objects includes support for custom classes, custom data classes, and named tuples. Serialization and deserialization of these objects is handled automatically by the SDK.
94
94
95
95
You can find the full sample [here](./examples/human_interaction.ts).
96
+
### Durable Entities (Stateful Actors)
96
97
98
+
Durable entities provide a way to manage small pieces of state with a simple object-oriented programming model:
You can find full entity samples [here](./examples/hello-world/entity-counter.ts) and [here](./examples/hello-world/entity-orchestration.ts).
97
124
## Feature overview
98
125
99
126
The following features are currently supported:
@@ -122,6 +149,10 @@ Orchestrations can wait for external events using the `wait_for_external_event`
122
149
123
150
Orchestrations can be continued as new using the `continue_as_new` API. This API allows an orchestration to restart itself from scratch, optionally with a new input.
124
151
152
+
### Durable Entities
153
+
154
+
Durable entities are stateful objects that can be accessed from orchestrations or directly from clients. They support operations that can read/modify state, and multiple entities can be locked together for atomic cross-entity transactions. See the detailed section below for more information.
155
+
125
156
### Suspend, resume, and terminate
126
157
127
158
Orchestrations can be suspended using the `suspend_orchestration` client API and will remain suspended until resumed using the `resume_orchestration` client API. A suspended orchestration will stop processing new events, but will continue to buffer any that happen to arrive until resumed, ensuring that no data is lost. An orchestration can also be terminated using the `terminate_orchestration` client API. Terminated orchestrations will stop processing new events and will discard any buffered events.
@@ -130,6 +161,120 @@ Orchestrations can be suspended using the `suspend_orchestration` client API and
130
161
131
162
Orchestrations can specify retry policies for activities and sub-orchestrations. These policies control how many times and how frequently an activity or sub-orchestration will be retried in the event of a transient error.
132
163
164
+
### Durable Entities
165
+
166
+
Durable entities are stateful objects that can be accessed and manipulated from orchestrations or directly from clients. Entities provide a way to manage small pieces of state that need to be accessed and updated reliably.
167
+
168
+
#### Defining an Entity
169
+
170
+
Entities are defined by extending the `TaskEntity` class:
0 commit comments