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
Copy file name to clipboardExpand all lines: doc/activities.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,13 @@
2
2
3
3
## What is an Activity?
4
4
5
-
Activities are implementations of certain tasks which need to be performed during a Workflow execution. They can be used to interact with external systems, such as databases, services, etc.
5
+
Activities are implementations of specific tasks performed during a Workflow execution. These tasks typically interact with external systems, such as databases, services, etc. They are free to block using conventional synchronization primitives or to run complex operations. An Activity forms the basis of a checkpoint, because the values entering and leaving an Activity become part of the Event History.
6
6
7
7
Workflows orchestrate invocations of Activities.
8
8
9
9
## Implementing Activities
10
10
11
-
An Activity implementation consists of defining a (defactivity) function. This function is invoked by the platform each time an Activity execution is started or retried. As soon as this method returns, the Activity execution is considered as completed and the result is available to the caller.
11
+
An Activity implementation consists of defining a (defactivity) function. The platform invokes this function each time an Activity execution is started by a Workflow or retried by the platform. Returning from the method signals that the Activity is considered complete. The result is then made available to the calling Workflow.
12
12
13
13
### Example
14
14
@@ -22,13 +22,13 @@ An Activity implementation consists of defining a (defactivity) function. This f
22
22
23
23
## Registering Activities
24
24
25
-
By default, Activities are automatically registered simply by declaring a (defactivity). You may optionally manually declare specific Activities to register when creating Workers (see [worker-options](https://cljdoc.org/d/io.github.manetu/temporal-sdk/CURRENT/api/temporal.client.worker#worker-options)).
25
+
By default, Activities are automatically registered simply by declaring a (defactivity). You may optionally manually specify Activities to register when creating Workers (see [worker-options](https://cljdoc.org/d/io.github.manetu/temporal-sdk/CURRENT/api/temporal.client.worker#worker-options)).
26
26
27
-
*It should be noted that the name of the Activity, the arguments that the Activity accepts, and the data that the Activity returns are all part of a contract that you need to maintain across potentially long-lived instances. Therefore, the Activity definition must be treated with care whenever code is refactored.*
27
+
*It should be noted that the name of the Activity, the arguments that the Activity accepts, and the data that the Activity returns are all part of a contract you need to maintain across potentially long-lived instances. Therefore, the Activity definition must be treated with care whenever refactoring code.*
28
28
29
29
## Starting Activity Executions
30
30
31
-
In this Clojure SDK, Activities are always started with either [invoke](https://cljdoc.org/d/io.github.manetu/temporal-sdk/CURRENT/api/temporal.activity#invoke) or [local-invoke](https://cljdoc.org/d/io.github.manetu/temporal-sdk/CURRENT/api/temporal.activity#local-invoke), both of which are called similarly. The primary difference between them is the execution model under the covers (See [What is a Local Activity](https://docs.temporal.io/concepts/what-is-a-local-activity/))
31
+
In this Clojure SDK, Workflows start Activities with either [invoke](https://cljdoc.org/d/io.github.manetu/temporal-sdk/CURRENT/api/temporal.activity#invoke) or [local-invoke](https://cljdoc.org/d/io.github.manetu/temporal-sdk/CURRENT/api/temporal.activity#local-invoke), both of which share similar calling conventions. The primary difference between them is the execution model under the covers (See [What is a Local Activity](https://docs.temporal.io/concepts/what-is-a-local-activity/))
32
32
33
33
### Example
34
34
@@ -44,7 +44,7 @@ In this Clojure SDK, Activities are always started with either [invoke](https://
44
44
45
45
## Asynchronous Mode
46
46
47
-
Returning a core.async channel places the activity into [Asynchronous mode](https://docs.temporal.io/java/activities/#asynchronous-activity-completion), where the result may be resolved at a future time by sending a single message on the channel. Sending a [Throwable](https://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html) will signal a failure of the activity. Any other value will be serialized and returned to the caller.
47
+
Returning a core.async channel places the Activity into [Asynchronous mode](https://docs.temporal.io/java/activities/#asynchronous-activity-completion). The Activity is then free to send a single message on the channel at a future time to signal completion. The value sent is returned to the calling Workflow. Sending a [Throwable](https://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html) will signal a failure of the Activity.
48
48
49
49
### Example
50
50
@@ -57,4 +57,4 @@ Returning a core.async channel places the activity into [Asynchronous mode](http
0 commit comments