Gio.bus_own_name_on_connection

function bus_own_name_on_connection(connection: Gio.DBusConnection, name: String, flags: Gio.BusNameOwnerFlags, name_acquired_closure: Function, name_lost_closure: Function): Number(guint) {
    // Gjs wrapper for g_bus_own_name_on_connection_with_closures()
}
  

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

Since 2.26

connection

a Gio.DBusConnection

name

the well-known name to own

flags

a set of flags from the Gio.BusNameOwnerFlags enumeration

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.