Skip to content

Commit 85c5043

Browse files
committed
Add new hasHeartbeatDetails property to Activity Info
1 parent bc35ca5 commit 85c5043

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Sources/Temporal/Worker/Activities/ActivityExecutionContext.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,15 @@ public struct ActivityExecutionContext: Sendable {
119119
/// The data converter used for payload serialization.
120120
private let dataConverter: DataConverter
121121

122+
/// Determine if the activity execution has heartbeat details from a previous activity attempt available.
123+
///
124+
/// Heartbeat details are preserved across activity retries, allowing activities to resume execution
125+
/// from a known checkpoint. If the activity info carries heartbeat details from a previous activity attempt,
126+
/// this property will return true.
127+
public var hasHeartbeatDetails: Bool {
128+
!self.heartbeatDetails.isEmpty
129+
}
130+
122131
/// Creates a new activity information instance.
123132
///
124133
/// - Parameters:

0 commit comments

Comments
 (0)