Skip to content

Commit cf63f9a

Browse files
authored
Reorganize Documentation: Move ReadOlny Methods description its own section (#44947)
1 parent e6ffbfe commit cf63f9a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/orleans/grains/request-scheduling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ public interface IMyGrain : IGrainWithIntegerKey
207207
}
208208
```
209209

210+
The `GetCount` method doesn't modify the grain state, so it's marked with `ReadOnly`. Callers awaiting this method invocation aren't blocked by other `ReadOnly` requests to the grain, and the method returns immediately.
211+
210212
### Call chain reentrancy
211213

212214
If a grain calls a method which on another grain which then calls back into the original grain, the call will result in a deadlock unless the call is reentrant. Reentrancy can be enabled on a per-call-site basis by using *call chain reentrancy*. To enable call chain reentrancy, call the <xref:Orleans.Runtime.RequestContext.AllowCallChainReentrancy> method, which returns a value that allows reentrance from any caller further down the call chain until it is disposed. This includes reentrance from the grain calling the method itself. Consider the following example:
@@ -254,8 +256,6 @@ If you were to instead prevent the deadlock by annotating the `GetDisplayName()`
254256

255257
Call chain reentrance can also be *suppressed* using the <xref:Orleans.Runtime.RequestContext.SuppressCallChainReentrancy> method. This has limited usefulness to end developers, but it is important for internal use by libraries which extend Orleans grain functionality, such as [streaming](../streaming/index.md) and [broadcast channels](../streaming/broadcast-channel.md) to ensure that developers retain full control over when call chain reentrancy is enabled.
256258

257-
The `GetCount` method doesn't modify the grain state, so it's marked with `ReadOnly`. Callers awaiting this method invocation aren't blocked by other `ReadOnly` requests to the grain, and the method returns immediately.
258-
259259
### Reentrancy using a predicate
260260

261261
Grain classes can specify a predicate to determine interleaving on a call-by-call basis by inspecting the request. The `[MayInterleave(string methodName)]` attribute provides this functionality. The argument to the attribute is the name of a static method within the grain class that accepts an <xref:Orleans.CodeGeneration.InvokeMethodRequest> object and returns a `bool` indicating whether or not the request should be interleaved.

0 commit comments

Comments
 (0)