p2pfl.communication.protocols.protobuff.server moduleΒΆ
Protobuff server.
- class p2pfl.communication.protocols.protobuff.server.ProtobuffServer(gossiper, neighbors, commands=None)[source]ΒΆ
Bases:
ABC
,NodeServicesServicer
,NodeComponent
Implementation of the server side logic of PROTOBUFF communication protocol.
- Parameters:
- disconnect(request, _)[source]ΒΆ
Service. It is called when a node disconnects from another.
- Parameters:
request (
HandShakeRequest
) β Request message._ (
ServicerContext
) β Context._
- Return type:
Empty
- handshake(request, _)[source]ΒΆ
Service. It is called when a node connects to another.
- Parameters:
request (
HandShakeRequest
) β Request message._ (
ServicerContext
) β Context._
- Return type:
ResponseMessage
- abstract is_running()[source]ΒΆ
Check if the server is running.
- Return type:
bool
- Returns:
True if the server is running, False otherwise.
- send(request, _)[source]ΒΆ
Service. Handles both regular messages and model weights.
- Parameters:
request (
RootMessage
) β The RootMessage containing either a Message or Weights payload._ (
ServicerContext
) β Context._
- Return type:
ResponseMessage