Gio.bus_own_name

function bus_own_name(bus_type: Gio.BusType, name: String, flags: Gio.BusNameOwnerFlags, bus_acquired_closure: Function, name_acquired_closure: Function, name_lost_closure: Function): Number(guint) {
    // Gjs wrapper for g_bus_own_name_with_closures()
}
  

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

Since 2.26

bus_type

the type of bus to own a name on

name

the well-known name to own

flags

a set of flags from the Gio.BusNameOwnerFlags enumeration

bus_acquired_closure

GObject.Closure to invoke when connected to the bus of type bus_type or null

name_acquired_closure

GObject.Closure to invoke when name is acquired or null

name_lost_closure

GObject.Closure to invoke when name is lost or null

Returns

an identifier (never 0) that an be used with Gio.bus_unown_name to stop owning the name.