Class MessageModuleOptionsBuilder<TSossObject>
Provides a builder for configuring and creating instances of MessageModuleOptions<TSossObject>.
public class MessageModuleOptionsBuilder<TSossObject>
Type Parameters
TSossObject
The type of object in ScaleOut StateServer (SOSS) that's used by the module.
- Inheritance
-
MessageModuleOptionsBuilder<TSossObject>
- Inherited Members
Remarks
This class allows you to configure options such as the module's lock mode and serialization behavior. Use the provided methods to set the desired configuration, and call Build() to create a MessageModuleOptions<TSossObject> instance.
Constructors
MessageModuleOptionsBuilder()
Constructs a new instance of the MessageModuleOptionsBuilder<TSossObject> class.
public MessageModuleOptionsBuilder()
Methods
Build()
public MessageModuleOptions<TSossObject> Build()
Returns
- MessageModuleOptions<TSossObject>
SetLockMode(LockMode)
Sets the lock mode for the message module and returns the updated options builder.
public MessageModuleOptionsBuilder<TSossObject> SetLockMode(LockMode lockMode)
Parameters
lockMode
LockModeThe lock mode to apply. Determines how the message module handles concurrency and locking.
Returns
- MessageModuleOptionsBuilder<TSossObject>
The updated MessageModuleOptionsBuilder<TSossObject> instance, allowing further configuration.
SetSerialization(Func<Stream, TSossObject>, Action<TSossObject, Stream>, bool)
Configures the serialization and deserialization behavior for the message module.
public MessageModuleOptionsBuilder<TSossObject> SetSerialization(Func<Stream, TSossObject> deserializer, Action<TSossObject, Stream> serializer, bool isJsonSerializer)
Parameters
deserializer
Func<Stream, TSossObject>A function that converts a Stream into an instance of
TSossObject
. This parameter cannot be null.serializer
Action<TSossObject, Stream>An action that serializes an instance of
TSossObject
into a Stream. This parameter cannot be null.isJsonSerializer
boolA value indicating whether the serializer and deserializer perform JSON serialization. true if JSON serialization is performed; otherwise, false for other serialization formats.
Returns
- MessageModuleOptionsBuilder<TSossObject>
The updated MessageModuleOptionsBuilder<TSossObject> instance, allowing further configuration.
Exceptions
- ArgumentNullException
Thrown if
deserializer
orserializer
is null.