GitHub

API reference for Service.

Receives inbound events: success hands the event to the consumer, NotAccepted refuses it.

Functions

__init__

__init__(handle) -> None
ParameterTypeDescription
handleCallable[[ChatEvent], Effect[None, NotAccepted]]
def __init__(self, handle: Callable[[ChatEvent], Effect[None, NotAccepted]]) -> None:
    self._handle = handle

handle

handle(event) -> Effect[None, NotAccepted]

Hands event to the consumer; NotAccepted refuses it.

ParameterTypeDescription
eventChatEvent

Returns Effect[None, NotAccepted]

def handle(self, event: ChatEvent) -> Effect[None, NotAccepted]:
    """Hands ``event`` to the consumer; ``NotAccepted`` refuses it."""
    return self._handle(event)