We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b70121a + 32a6e3f commit 7d651b6Copy full SHA for 7d651b6
1 file changed
dbus_next/proxy_object.py
@@ -6,11 +6,12 @@
6
from .errors import DBusError, InterfaceNotFoundError
7
from ._private.util import replace_idx_with_fds
8
9
-from typing import Type, Union, List
+from typing import Type, Union, List, Coroutine
10
import logging
11
import xml.etree.ElementTree as ET
12
import inspect
13
import re
14
+import asyncio
15
16
17
class BaseProxyInterface:
@@ -97,7 +98,9 @@ def _message_handler(self, msg):
97
98
99
body = replace_idx_with_fds(msg.signature, msg.body, msg.unix_fds)
100
for handler in self._signal_handlers[msg.member]:
- handler(*body)
101
+ cb_result = handler(*body)
102
+ if isinstance(cb_result, Coroutine):
103
+ asyncio.create_task(cb_result)
104
105
def _add_signal(self, intr_signal, interface):
106
def on_signal_fn(fn):
0 commit comments