Gio.bus_watch_name

function bus_watch_name(bus_type: Gio.BusType, name: String, flags: Gio.BusNameWatcherFlags, name_appeared_closure: Function, name_vanished_closure: Function): Number(guint) {
    // Gjs wrapper for g_bus_watch_name_with_closures()
}
  

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

Since 2.26

bus_type

The type of bus to watch a name on.

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.