p2pfl.communication.protocols.protobuff.protobuff_communication_protocol module

GRPC communication protocol.

class p2pfl.communication.protocols.protobuff.protobuff_communication_protocol.ProtobuffCommunicationProtocol(commands=None)[source]

Bases: CommunicationProtocol

Protobuff communication protocol.

Parameters:
  • addr – Address of the node.

  • commands (Optional[list[Command]]) – Commands to add to the communication protocol.

Todo

Decouple the heeartbeat command.

add_command(*args: Any, **kwargs: Any) Any
Return type:

Any

bluid_client(*args: Any, **kwargs: Any) Any
Return type:

Any

broadcast(*args: Any, **kwargs: Any) Any
Return type:

Any

build_msg(*args: Any, **kwargs: Any) Any
Return type:

Any

build_server(*args: Any, **kwargs: Any) Any
Return type:

Any

build_weights(*args: Any, **kwargs: Any) Any
Return type:

Any

connect(*args: Any, **kwargs: Any) Any
Return type:

Any

disconnect(*args: Any, **kwargs: Any) Any
Return type:

Any

get_neighbors(*args: Any, **kwargs: Any) Any
Return type:

Any

gossip_weights(*args: Any, **kwargs: Any) Any
Return type:

Any

send(*args: Any, **kwargs: Any) Any
Return type:

Any

set_addr(addr)[source]

Set the addr of the node.

Return type:

str

start(*args: Any, **kwargs: Any) Any
Return type:

Any

stop(*args: Any, **kwargs: Any) Any
Return type:

Any

wait_for_termination(*args: Any, **kwargs: Any) Any
Return type:

Any

p2pfl.communication.protocols.protobuff.protobuff_communication_protocol.running(func)[source]

Ensure that the server is running before executing a method.