Skip to content

Commit da2c2c0

Browse files
ReubenBondgewarren
andauthored
Update docs/orleans/grains/cancellation-tokens.md
Co-authored-by: Genevieve Warren <[email protected]>
1 parent 4b23f6f commit da2c2c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/orleans/grains/cancellation-tokens.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Orleans supports passing <xref:System.Threading.CancellationToken> instances to
1616
- Streaming methods that return `IAsyncEnumerable<T>`
1717
- Both client-to-grain and grain-to-grain calls
1818

19-
Cancellation is cooperative, meaning your grain implementation must observe the token and respond appropriately for it to be effective. If a cancellation token is not observed, the runtime will not automatically stop a method from executing. This is behavior is consistent with the majority of libraries which support <xref:System.Threading.CancellationToken>. In other words, .NET uses cooperative cancellation. The major benefit of this approach is that cancellation can only occur at clearly identifiable points, not at any given instruction. This lets you run cleanup logic when cancellation is signalled.
19+
Cancellation is cooperative, meaning your grain implementation must observe the token and respond appropriately for it to be effective. If a cancellation token is not observed, the runtime will not automatically stop a method from executing. This behavior is consistent with the majority of libraries that support <xref:System.Threading.CancellationToken>. In other words, .NET uses cooperative cancellation. The major benefit of this approach is that cancellation can only occur at clearly identifiable points, not at any given instruction. This lets you run cleanup logic when cancellation is signalled.
2020

2121
Before a grain call is made, the runtime checks if the provided <xref:System.Threading.CancellationToken> is already canceled. If so, it immediately throws an <xref:System.OperationCanceledException> without issuing the request. Similarly, if an enqueued request is canceled before a grain begins executing it, it is cancelled without being executed.
2222

0 commit comments

Comments
 (0)