Dee.Peer¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
class |
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
Unique DBus address of the swarm leader |
||
r/w/c |
Well-known name to find other peers with |
||
r/w/co |
Try to assume leadership of the swarm |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Connect to this signal to be notified when peers close their |
|
Connect to this signal to be notified of existing and new peers that are in your swarm. |
|
Connect to this signal to be notified when peers disconnect from the swarm |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
||
priv |
r |
Class Details¶
- class Dee.Peer(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
All fields in the
Dee.Peer
structure are private and should never be accessed directly- classmethod new(swarm_name)¶
- Parameters:
swarm_name (
str
) – The name of the swarm to join. Fx “org.example.DataProviders”- Returns:
A newly constructed
Dee.Peer
. Free withGObject.Object.unref
().- Return type:
Create a new
Dee.Peer
. The peer will immediately connect to the swarm and start the peer discovery.
- get_connections()¶
- Returns:
List of connections.
- Return type:
Gets list of
Gio.DBusConnection
instances used by thisDee.Peer
instance.
- get_swarm_leader()¶
- Returns:
Unique DBus address of the current swarm leader, possibly
None
if the leader has not been detected yet- Return type:
In case this peer is connected to a message bus, gets the unique DBus address of the current swarm leader, otherwise returns id of the leader.
- get_swarm_name()¶
- Returns:
The swarm name
- Return type:
Gets the unique name for this swarm. The swarm leader is the Peer owning this name on the session bus.
- is_swarm_leader()¶
- is_swarm_owner()¶
- Returns:
True
if the:swarm-owner
property was set during construction.- Return type:
Gets the value of the
:swarm-owner
property.Note that this does NOT mean that the peer is leader of the swarm! Check also
Dee.Peer.is_swarm_leader
().
- list_peers()¶
- Returns:
List of peers (free using
GLib.strfreev
()).- Return type:
[
str
]
Gets list of all peers currently in this swarm.
- do_connection_acquired(connection) virtual¶
- Parameters:
connection (
Gio.DBusConnection
) –
- do_connection_closed(connection) virtual¶
- Parameters:
connection (
Gio.DBusConnection
) –
- do_get_connections() virtual¶
- Returns:
List of connections.
- Return type:
Gets list of
Gio.DBusConnection
instances used by thisDee.Peer
instance.
- do_get_swarm_leader() virtual¶
- Returns:
Unique DBus address of the current swarm leader, possibly
None
if the leader has not been detected yet- Return type:
In case this peer is connected to a message bus, gets the unique DBus address of the current swarm leader, otherwise returns id of the leader.
- do_is_swarm_leader() virtual¶
- do_list_peers() virtual¶
- Returns:
List of peers (free using
GLib.strfreev
()).- Return type:
[
str
]
Gets list of all peers currently in this swarm.
Signal Details¶
- Dee.Peer.signals.connection_acquired(peer, object)¶
- Signal Name:
connection-acquired
- Flags:
- Parameters:
peer (
Dee.Peer
) – The object which received the signalobject (
Gio.DBusConnection
) –
- Dee.Peer.signals.connection_closed(peer, connection)¶
- Signal Name:
connection-closed
- Flags:
- Parameters:
peer (
Dee.Peer
) – The object which received the signalconnection (
Gio.DBusConnection
) – the closedGio.DBusConnection
Connect to this signal to be notified when peers close their
Gio.DBusConnection
.
- Dee.Peer.signals.peer_found(peer, name)¶
- Signal Name:
peer-found
- Flags:
- Parameters:
Connect to this signal to be notified of existing and new peers that are in your swarm.
Property Details¶
- Dee.Peer.props.swarm_leader¶
-
Unique DBus address of the swarm leader
- Dee.Peer.props.swarm_name¶
-
Well-known name to find other peers with