Click or drag to resize

WorkflowNextRandomBytesAsync Method

Returns a replay safe byte array filled with random values.

Note Note
This must be used instead of something like Random to guarantee determinism when a workflow is replayed.

Namespace:  Neon.Cadence
Assembly:  Neon.Cadence (in Neon.Cadence.dll) Version: 2.14.0
Syntax
public Task<byte[]> NextRandomBytesAsync(
	int size
)

Parameters

size
Type: SystemInt32
The size of the byte array returned (must be positive)..

Return Value

Type: TaskByte
The random bytes.
Exceptions
ExceptionCondition
ObjectDisposedExceptionThrown if the associated Cadence client is disposed.
NotSupportedExceptionThrown when this is called outside of a workflow entry point method.
Remarks
Note Note
The internal random number generator is seeded such that workflow instances will generally see different sequences of random numbers.
See Also