import logging
from threading import Thread

from ._HandleMessageStrategy import HandleMessageStrategy

logger = logging.getLogger(__name__)


class ThreadedHandleMessageStrategy(HandleMessageStrategy):
    def handle_message(self, executor, message):
        t = Thread(target=executor.handle_message, args=(message,))
        t.daemon = True
        t.start()
