Skip to content

[communication]

Submodule implementing client/server communications.

This is done by defining server-side and client-side network communication endpoints for federated learning processes, as well as suitable messages to be transmitted, and the available communication protocols.

This module contains the following core submodules:

  • api: Base API to define client- and server-side communication endpoints.
  • utils: Utils related to network communication endpoints' setup and usage.

It re-exports publicly from utils the following elements:

  • build_client: Instantiate a NetworkClient, selecting its subclass based on protocol name.
  • build_server: Instantiate a NetworkServer, selecting its subclass based on protocol name.
  • list_available_protocols: List the protocol names for which both a NetworkClient and NetworkServer classes are registered (hence available to build_client/build_server).
  • NetworkClientConfig: TOML-parsable dataclass for network clients' instantiation.
  • NetworkServerConfig: TOML-parsable dataclass for network servers' instantiation.

Finally, it defines the following protocol-specific submodules, provided the associated third-party dependencies are available:

  • grpc: gRPC-based network communication endpoints. Requires the grpcio and protobuf third-party packages.
  • websockets: WebSockets-based network communication endpoints. Requires the websockets third-party package.

Additionnally, for retro-compatibility purposes, it exports the DEPRECATED messaging submodule, that should no longer be used, as its contents were re-dispatched elsewhere in DecLearn.