Dispatcher API
Ice.Object Interface
For historical reasons, the Dispatcher abstraction does not correspond to a Dispatcher interface in C#. We use instead the interface Ice.Object as the base interface for dispatchers.
Object is a interface that provides the default implementation for the pseudo Slice interface Object:
namespace Ice;
[SliceTypeId("::Ice::Object")]
public interface Object
{
public ValueTask<OutgoingResponse> dispatchAsync(IncomingRequest request)
{
...
}
...
}
The implementation of dispatch on Ice.Object dispatches an incoming request to the 4 operations defined on Object: ice_id, ice_ids, ice_isA, and ice_ping. It throws OperationNotExistException for any other operation.
This implementation is immaterial: in practice, a dispatcher is any C# class that implements Ice.Objectand reimplements dispatch. This dispatcher may (but does not need to) implement the 4 operations defined on Object.
Servants
In C#, a servant is a concrete class that implements the Dispatcher abstraction by itself, without delegating to some other object. In other words, a servant is a “terminal dispatcher”. A servant should generally handle the 4 operations defined on the pseudo-Slice interface Object.
The most common type of C# servants are classes that implement skeleton classes generated by the Slice compiler. These generated skeleton classes reimplement dispatch by:
unmarshaling input parameters
calling the pure virtual member function whose name matches the operation name carried by the request (you implement this pure virtual function in the servant class)
creating a response from the return value and out parameters returned by this function
They also implement or reimplement the 4 operations defined on Object.