Class ApiProcessor<TSossObject>
- Namespace
- Scaleout.Modules.Abstractions
- Assembly
- Scaleout.Modules.Abstractions.dll
Base class for implementing a custom API module processor.
public abstract class ApiProcessor<TSossObject>
Type Parameters
TSossObject
Type of object stored in the ScaleOut StateServer (SOSS) service.
- Inheritance
-
ApiProcessor<TSossObject>
- Inherited Members
Remarks
In addition to implementing a CreateObject method, an ApiProcessor implementation must implement at least one operation handler method.
The signature of the operation handler method must be marked with the SossApiMethodAttribute attribute and have the following signature:
[SossApiMethod(OperationId="Foo", LockingMode=ApiProcessorLockingMode.None)]
public Task<InvokeResult> FooAsync(ProcessingContext<TSossObject> context, TSossObject sossObject, byte[] args)
Methods
CreateObject(string, string)
Factory callback for creating a new TSossObject
object instance.
Called by the runtime when a message is sent to an object that does not exist in the ScaleOut service.
The operation handler method specified by the user
will be called immediately after this method returns,
and the newly created object will be passed as the sossObject parameter.
public abstract CreateResult<TSossObject> CreateObject(string moduleName, string objectId)
Parameters
moduleName
stringName of your message processing module, as supplied to ModulePackage.AddMsgModule().
objectId
stringUnique ID of the object in the ScaleOut service.
Returns
- CreateResult<TSossObject>