@temporalio/activity
Advanced tools
Comparing version 0.4.0 to 0.11.0
@@ -101,3 +101,3 @@ /** | ||
/** | ||
* Holds information about the current executing Activity | ||
* Holds information about the current executing Activity. | ||
*/ | ||
@@ -119,9 +119,5 @@ info: Info; | ||
/** | ||
* Send a heartbeat from an Activity. | ||
* | ||
* If an Activity times out, the last value of details is included in the {@link ActivityFailure} delivered to a Workflow in the `cause` attribute which will be set to {@link TimeoutFailure}. Then the Workflow can pass the details to the next Activity invocation. This acts as a periodic checkpoint mechanism for the progress of an Activity. | ||
* | ||
* The Activity must heartbeat in order to receive cancellation. | ||
* The heartbeat implementation, injected via the constructor. | ||
*/ | ||
readonly heartbeat: (details?: any) => void; | ||
protected readonly heartbeatFn: (details?: any) => void; | ||
/** | ||
@@ -134,2 +130,10 @@ * **Not** meant to instantiated by Activity code, used by the worker. | ||
/** | ||
* Send a heartbeat from an Activity. | ||
* | ||
* If an Activity times out, the last value of details is included in the {@link ActivityFailure} delivered to a Workflow in the `cause` attribute which will be set to {@link TimeoutFailure}. Then the Workflow can pass the details to the next Activity invocation. This acts as a periodic checkpoint mechanism for the progress of an Activity. | ||
* | ||
* The Activity must heartbeat in order to receive cancellation. | ||
*/ | ||
heartbeat(details?: unknown): void; | ||
/** | ||
* Gets the context of the current Activity. | ||
@@ -136,0 +140,0 @@ * |
@@ -50,5 +50,15 @@ "use strict"; | ||
this.cancellationSignal = cancellationSignal; | ||
this.heartbeat = heartbeat; | ||
this.heartbeatFn = heartbeat; | ||
} | ||
/** | ||
* Send a heartbeat from an Activity. | ||
* | ||
* If an Activity times out, the last value of details is included in the {@link ActivityFailure} delivered to a Workflow in the `cause` attribute which will be set to {@link TimeoutFailure}. Then the Workflow can pass the details to the next Activity invocation. This acts as a periodic checkpoint mechanism for the progress of an Activity. | ||
* | ||
* The Activity must heartbeat in order to receive cancellation. | ||
*/ | ||
heartbeat(details) { | ||
this.heartbeatFn(details); | ||
} | ||
/** | ||
* Gets the context of the current Activity. | ||
@@ -55,0 +65,0 @@ * |
{ | ||
"name": "@temporalio/activity", | ||
"version": "0.4.0", | ||
"version": "0.11.0", | ||
"description": "Temporal.io SDK Activity sub-package", | ||
@@ -25,3 +25,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "254e9f5793afc11cb5fb64a9829b1c55190092f0" | ||
"gitHead": "df1ef24e1caff78f2b712e1f82e59d037ae9c2b4" | ||
} |
@@ -104,3 +104,3 @@ /** | ||
/** | ||
* Holds information about the current executing Activity | ||
* Holds information about the current executing Activity. | ||
*/ | ||
@@ -122,9 +122,5 @@ public info: Info; | ||
/** | ||
* Send a heartbeat from an Activity. | ||
* | ||
* If an Activity times out, the last value of details is included in the {@link ActivityFailure} delivered to a Workflow in the `cause` attribute which will be set to {@link TimeoutFailure}. Then the Workflow can pass the details to the next Activity invocation. This acts as a periodic checkpoint mechanism for the progress of an Activity. | ||
* | ||
* The Activity must heartbeat in order to receive cancellation. | ||
* The heartbeat implementation, injected via the constructor. | ||
*/ | ||
public readonly heartbeat: (details?: any) => void; | ||
protected readonly heartbeatFn: (details?: any) => void; | ||
@@ -145,6 +141,17 @@ /** | ||
this.cancellationSignal = cancellationSignal; | ||
this.heartbeat = heartbeat; | ||
this.heartbeatFn = heartbeat; | ||
} | ||
/** | ||
* Send a heartbeat from an Activity. | ||
* | ||
* If an Activity times out, the last value of details is included in the {@link ActivityFailure} delivered to a Workflow in the `cause` attribute which will be set to {@link TimeoutFailure}. Then the Workflow can pass the details to the next Activity invocation. This acts as a periodic checkpoint mechanism for the progress of an Activity. | ||
* | ||
* The Activity must heartbeat in order to receive cancellation. | ||
*/ | ||
public heartbeat(details?: unknown): void { | ||
this.heartbeatFn(details); | ||
} | ||
/** | ||
* Gets the context of the current Activity. | ||
@@ -151,0 +158,0 @@ * |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
40860
418