From 3c221246dc9d05fe4f980b8064c229a031c8a1d0 Mon Sep 17 00:00:00 2001 From: Mihai Dumitru Date: Thu, 5 Jan 2023 09:34:18 +0200 Subject: 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 --- dbus/connection.py | 2 ++ 1 file changed, 2 insertions(+) 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 -- cgit v1.2.1