diff options
author | Mihai Dumitru <mihai.dumitru@ispoq.ro> | 2023-01-05 09:34:18 +0200 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2023-01-20 15:24:55 +0000 |
commit | 3c221246dc9d05fe4f980b8064c229a031c8a1d0 (patch) | |
tree | e8422bf5b42153a61043defca192effd3ec1fc2c /dbus | |
parent | f1d05153b943b6c46192323ead096d5ca177f99e (diff) | |
download | dbus-python-3c221246dc9d05fe4f980b8064c229a031c8a1d0.tar.gz |
connection: Set NO_REPLY flag if there's no handler
If we do an async call with no handler, it doesn't matter whether the
implementation replies with a result or an error, because either way
we will ignore it. Normally, the method implementation is expected to
reply to all method calls, but with the NO_REPLY flag set, it can
optimize by not sending a reply at all, which also means the message
bus does not have to keep track of pending replies.
Co-authored-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'dbus')
-rw-r--r-- | dbus/connection.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/dbus/connection.py b/dbus/connection.py index fd20800..46d74d4 100644 --- a/dbus/connection.py +++ b/dbus/connection.py @@ -577,6 +577,8 @@ class Connection(_Connection): if reply_handler is None and error_handler is None: # we don't care what happens, so just send it + # (and we can let the recipient optimize by not replying to us) + message.set_no_reply(True) self.send_message(message) return |