Gio.DBusConnection.prototype.flush
function flush(cancellable: Gio.Cancellable, callback: Gio.AsyncReadyCallback): void { // Gjs wrapper for g_dbus_connection_flush() }
Asynchronously flushes connection, that is, writes all queued outgoing message to the transport and then flushes the transport (using Gio.OutputStream.prototype.flush_async). This is useful in programs that wants to emit a D-Bus signal and then exit immediately. Without flushing the connection, there is no guaranteed that the message has been sent to the networking buffers in the OS kernel.
This is an asynchronous method. When the operation is finished, callback will be invoked in the [thread-default main context][g-main-context-push-thread-default] of the thread you are calling this method from. You can then call Gio.DBusConnection.prototype.flush_finish to get the result of the operation. See Gio.DBusConnection.prototype.flush_sync for the synchronous version.
Since 2.26
- cancellable
a Gio.Cancellable or null
- callback
a Gio.AsyncReadyCallback to call when the request is satisfied or null if you don't care about the result