Immutable<T> Struct
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Wrapper class for carrying immutable data.
public struct Immutable<T>
[Orleans.GenerateSerializer]
[Orleans.Immutable]
public readonly struct Immutable<T>
type Immutable<'T> = struct
[<Orleans.GenerateSerializer>]
[<Orleans.Immutable>]
type Immutable<'T> = struct
Public Structure Immutable(Of T)
- T
Type of data to be wrapped by this Immutable
- Inheritance
-
Immutable<T>
- Attributes
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 receiver 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[] (for example, if it contains bytes from a static image file read from disk) then considerable savings in memory usage and message throughput can be obtained by marking that byte[] argument as Immutable
.
Immutable<T>(T) |
Constructor to wrap the specified data object in new Immutable wrapper. |
Value |
Return reference to the original value stored in this Immutable wrapper. |
Value |
Return reference to the original value stored in this Immutable wrapper. |
منتج | الإصدارات |
---|---|
.NET Orleans | 1.5.10, 3.4.5, 3.6.0, 7.0.0, 8.0.0, 8.1.0, 8.2.0, 9.0.0 |