Example #1
0
def send_event(event: Event) -> None:
    event_type = get_event_type(event)

    event_message = EventMessage(
        event_type=event_type,
        event=event.copy(deep=True),
        instance_id=get_instance_id(),
        instance_name=get_instance_name(),
    )

    # work around odd bug with Event Message creation.  See PR 939
    if event_message.event != event:
        event_message.event = event.copy(deep=True)

    log_event(event, event_type)
    queue_signalr_event(event_message)
    Webhook.send_event(event_message)
Example #2
0
 def ping(self) -> EventPing:
     ping = EventPing(ping_id=uuid4())
     self._add_event(
         EventMessage(
             event_type=EventType.ping,
             event=ping,
             instance_id=get_instance_id(),
             instance_name=get_instance_name(),
         ))
     return ping
Example #3
0
def send_event(event: Event) -> None:
    event_type = get_event_type(event)
    log_event(event, event_type)
    event_message = EventMessage(
        event_type=event_type,
        event=event,
        instance_id=get_instance_id(),
        instance_name=get_instance_name(),
    )
    EVENTS.put(event_message)
    Webhook.send_event(event_message)
Example #4
0
def send_event(event: Event) -> None:
    event_type = get_event_type(event)
    logging.info("sending event: %s - %s", event_type, event)
    event_message = EventMessage(
        event_type=event_type,
        event=event,
        instance_id=get_instance_id(),
        instance_name=get_instance_name(),
    )
    EVENTS.put(event_message)
    Webhook.send_event(event_message)
Example #5
0
 def ping(self) -> EventPing:
     ping = EventPing(ping_id=uuid4())
     self._add_event(EventMessage(event_type=EventType.ping, event=ping))
     return ping
Example #6
0
def send_event(event: Event) -> None:
    event_type = get_event_type(event)
    logging.info("sending event: %s - %s", event_type, event)
    event_message = EventMessage(event_type=event_type, event=event)
    EVENTS.put(event_message)
    Webhook.send_event(event_message)
Example #7
0
 def handler(self, message: Any) -> None:
     for event_raw in message:
         message = EventMessage.parse_obj(event_raw)
         self.cache.add_message(message)