p2pfl.communication.protocols.protobuff.memory.server moduleΒΆ

In-memory server.

class p2pfl.communication.protocols.protobuff.memory.server.AddressCounter[source]ΒΆ

Bases: object

Singleton address counter with efficient address tracking.

get(base_name)[source]ΒΆ

Get a unique address based on the given base name.

Parameters:

base_name (str) – The base name for the address. If empty, β€œnode” will be used.

Return type:

str

Returns:

A unique address string

class p2pfl.communication.protocols.protobuff.memory.server.MemoryServer(gossiper, neighbors, commands=None)[source]ΒΆ

Bases: ProtobuffServer

Implementation of the server side logic of Memory communication protocol.

Parameters:
  • addr – Address of the server.

  • gossiper (Gossiper) – Gossiper instance.

  • neighbors (Neighbors) – Neighbors instance.

  • commands (Optional[list[Command]]) – List of commands to be executed by the server.

is_running(*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