SimpleClientManager

class SimpleClientManager[source]

Bases : ClientManager

Provides a pool of available clients.

Methods

all()

Return all available clients.

num_available()

Return the number of available clients.

register(client)

Register Flower ClientProxy instance.

sample(num_clients[, min_num_clients, criterion])

Sample a number of Flower ClientProxy instances.

unregister(client)

Unregister Flower ClientProxy instance.

wait_for(num_clients[, timeout])

Wait until at least num_clients are available.

all() dict[str, ClientProxy][source]

Return all available clients.

num_available() int[source]

Return the number of available clients.

Renvoie:

num_available – The number of currently available clients.

Type renvoyé:

int

register(client: ClientProxy) bool[source]

Register Flower ClientProxy instance.

Paramètres:

client (flwr.server.client_proxy.ClientProxy)

Renvoie:

success – Indicating if registration was successful. False if ClientProxy is already registered or can not be registered for any reason.

Type renvoyé:

bool

sample(num_clients: int, min_num_clients: int | None = None, criterion: Criterion | None = None) list[ClientProxy][source]

Sample a number of Flower ClientProxy instances.

unregister(client: ClientProxy) None[source]

Unregister Flower ClientProxy instance.

This method is idempotent.

Paramètres:

client (flwr.server.client_proxy.ClientProxy)

wait_for(num_clients: int, timeout: int = 86400) bool[source]

Wait until at least num_clients are available.

Blocks until the requested number of clients is available or until a timeout is reached. Current timeout default: 1 day.

Paramètres:
  • num_clients (int) – The number of clients to wait for.

  • timeout (int) – The time in seconds to wait for, defaults to 86400 (24h).

Renvoie:

success

Type renvoyé:

bool