class documentation

Internal representation of an instance of a user's service handler class.

A service handler is a class decorated with @nexusrpc.handler.service_handler that defines operation handler methods using decorators such as @nexusrpc.handler.operation_handler.

Instances of this class are created automatically from user service implementation instances on creation of a Handler instance, at Nexus handler start time. While the user's class defines operation handlers as factory methods to be called at handler start time, this class contains the OperationHandler instances themselves.

You may create instances of this class manually and pass them to the Handler constructor, for example when programmatically creating Nexus service implementations.

Class Method from_user_instance Create a ServiceHandler from a user service instance.
Class Variable operation_handlers Undocumented
Class Variable service Undocumented
Method _get_operation_handler Return an operation handler, given the operation name.
@classmethod
def from_user_instance(cls, user_instance: Any) -> Self:

Create a ServiceHandler from a user service instance.

operation_handlers: dict[str, OperationHandler[Any, Any]] =

Undocumented

service: ServiceDefinition =

Undocumented

def _get_operation_handler(self, operation_name: str) -> OperationHandler[Any, Any]:

Return an operation handler, given the operation name.