from messagebus import (
    MessageBus,
    Event,
)
from model import (
    NewEventListener,
    EventPublishDetail,
)


class TargetedEventsAsyncPublisher(NewEventListener):
    def __init__(self, message_bus: MessageBus):
        self.message_bus = message_bus

    def new_event(self, publish_detail: EventPublishDetail):
        pass

    @staticmethod
    def _clone_as_async(event: Event):
        return Event(
            subject=event.subject,
            event_type=event.event_type,
            data=event.data,
            source=event.source,
            synchronous=False,
            timeout=event.timeout,
            headers=event.headers,
            ttl=event.ttl,
        )
