Training
Module
Build your first Orleans app with ASP.NET Core 8.0 - Training
Learn how to build cloud-native, distributed apps with Orleans.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Grains perform asynchronous request execution, requiring all grain interface methods to return an asynchronous type, like Task. Awaiting the completion of a task returned from a grain call notifies the caller that the request has finished, allowing them to handle any exceptions or receive return values. Orleans also supports one-way requests, enabling callers to notify a grain about an event without expecting exceptions or completion signals.
One-way requests return to the caller immediately and don't signal failure or completion. A one-way request doesn't even guarantee that the callee received the request. The primary benefit of a one-way request is that they save messaging costs associated with sending a response back to the caller and can therefore improve performance in some specialized cases. One-way requests are an advanced performance feature and should be used with care and only when a developer has determined that a one-way request is beneficial. It's recommended to prefer regular bi-directional requests, which signal completion and propagate errors back to callers.
A request can be made one way by marking the grain interface method with the OneWayAttribute, like so:
public interface IOneWayGrain : IGrainWithGuidKey
{
[OneWay]
Task Notify(MyData data);
}
One-way requests must return either Task or ValueTask and must not return generic variants of those types (Task<TResult> and ValueTask<TResult>).
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Training
Module
Build your first Orleans app with ASP.NET Core 8.0 - Training
Learn how to build cloud-native, distributed apps with Orleans.