Gio.bus_watch_name_on_connection

function bus_watch_name_on_connection(connection: Gio.DBusConnection, name: String, flags: Gio.BusNameWatcherFlags, name_appeared_closure: Function, name_vanished_closure: Function): Number(guint) {
    // Gjs wrapper for g_bus_watch_name_on_connection_with_closures()
}
  

Version of Gio.bus_watch_name_on_connection using closures instead of callbacks for easier binding in other languages.

Since 2.26

connection

A Gio.DBusConnection.

name

The name (well-known or unique) to watch.

flags

Flags from the Gio.BusNameWatcherFlags enumeration.

name_appeared_closure

GObject.Closure to invoke when name is known to exist or null.

name_vanished_closure

GObject.Closure to invoke when name is known to not exist or null.

Returns

An identifier (never 0) that an be used with Gio.bus_unwatch_name to stop watching the name.