Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion apprise/py3compat/asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

import sys
import asyncio
from concurrent.futures import ThreadPoolExecutor
from functools import partial
from ..URLBase import URLBase
from ..logger import logger

Expand Down Expand Up @@ -101,7 +103,12 @@ async def async_notify(self, *args, **kwargs): # noqa: E999
Async Notification Wrapper
"""
try:
return self.notify(*args, **kwargs)
loop = asyncio.get_event_loop()
with ThreadPoolExecutor() as executor:
return await loop.run_in_executor(
executor,
partial(self.notify, *args, **kwargs),
)

except TypeError:
# These our our internally thrown notifications
Expand Down