Documentation for Externalconnectionservice Module¶
ExternalConnectionService
¶
Bases: ABC
Abstract base class for an external connection service in a DFL federation.
This interface defines the required methods for any service responsible for discovering federations and managing beacon signals that announce node presence in the network.
Source code in nebula/core/network/externalconnection/externalconnectionservice.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
find_federation()
abstractmethod
async
¶
Attempt to discover other federations or nodes in the network.
This method is used by a node to actively search for potential neighbors to join a federation or to bootstrap its own.
Source code in nebula/core/network/externalconnection/externalconnectionservice.py
43 44 45 46 47 48 49 50 51 |
|
is_running()
abstractmethod
async
¶
Check whether the external connection service is currently active.
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the service is running, False otherwise. |
Source code in nebula/core/network/externalconnection/externalconnectionservice.py
33 34 35 36 37 38 39 40 41 |
|
modify_beacon_frequency(frequency)
abstractmethod
async
¶
Modify the frequency at which beacon messages are sent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
frequency
|
float
|
New beacon interval in seconds. |
required |
Source code in nebula/core/network/externalconnection/externalconnectionservice.py
73 74 75 76 77 78 79 80 81 |
|
start()
abstractmethod
async
¶
Start the external connection service.
This typically involves initializing discovery mechanisms and preparing to receive or send messages related to federation discovery.
Source code in nebula/core/network/externalconnection/externalconnectionservice.py
13 14 15 16 17 18 19 20 21 |
|
start_beacon()
abstractmethod
async
¶
Start periodically sending beacon messages to announce node presence.
Beacon messages help other nodes detect and identify this node's existence and availability on the network.
Source code in nebula/core/network/externalconnection/externalconnectionservice.py
53 54 55 56 57 58 59 60 61 |
|
stop()
abstractmethod
async
¶
Stop the external connection service.
This should gracefully shut down any background tasks or sockets associated with discovery or beaconing.
Source code in nebula/core/network/externalconnection/externalconnectionservice.py
23 24 25 26 27 28 29 30 31 |
|
stop_beacon()
abstractmethod
async
¶
Stop sending beacon messages.
This disables periodic presence announcements, making the node temporarily invisible to passive discovery.
Source code in nebula/core/network/externalconnection/externalconnectionservice.py
63 64 65 66 67 68 69 70 71 |
|
ExternalConnectionServiceException
¶
Bases: Exception
Exception raised for errors related to external connection services.
Source code in nebula/core/network/externalconnection/externalconnectionservice.py
84 85 86 87 88 89 |
|
factory_connection_service(con_serv, addr)
¶
Factory method to instantiate the appropriate external connection service.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
con_serv
|
str
|
Identifier of the connection service to use. |
required |
addr
|
str
|
Address of the node. |
required |
Returns:
Name | Type | Description |
---|---|---|
ExternalConnectionService |
ExternalConnectionService
|
An instance of the requested service. |
Raises:
Type | Description |
---|---|
ExternalConnectionServiceException
|
If the service identifier is not recognized. |
Source code in nebula/core/network/externalconnection/externalconnectionservice.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|