Struct Immutable<T>
Wrapper class for carrying immutable data.
Namespace: Orleans.Concurrency
Assembly: Orleans.Core.Abstractions.dll
Syntax
public struct Immutable<T>
Type Parameters
Name | Description |
---|---|
T | Type of data to be wrapped by this Immutable |
Remarks
Objects that are known to be immutable are given special fast-path handling by the Orleans serializer -- which in a nutshell allows the DeepCopy step to be skipped during message sends where the sender and reveiving grain are in the same silo.
One very common usage pattern for Immutable is when passing byte[] parameters to a grain.
If a program knows it will not alter the contents of the byte
then considerable savings in memory usage and message throughput can be obtained by marking that byte[] argument as Immutable
.
Constructors
| Improve this Doc View SourceImmutable(T)
Constructor to wrap the specified data object in new Immutable wrapper.
Declaration
public Immutable(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | Value to be wrapped and marked as immutable. |
Properties
| Improve this Doc View SourceValue
Return reference to the original value stored in this Immutable wrapper.
Declaration
public T Value { get; }
Property Value
Type | Description |
---|---|
T |