Source code for kappa_sdk.user_tasks.event_publisher
from datetime import datetime
from typing import runtime_checkable, Protocol
[docs]
@runtime_checkable
class EventPublisher(Protocol):
    """Event publisher.
    .. note:: Should not be instantiated directly.
    """
[docs]
    def publish(self, from_date: datetime, to_date: datetime, value: str) -> None:
        """Publishes an event.
        Publishes an event associated with the currently running User Task. Does not publish if run in simulation mode.
        Parameters
        ----------
        from_date:
            The date when the event started.
        to_date:
            The date when the event has finished.
        value:
            Any additional information that should be published with this User Task event.
        Raises
        ------
        TypeError
            If parameters have unexpected types.
        """