ClientManager#

class ClientManager[源代码]#

基类:ABC

Abstract base class for managing Flower 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.

abstract all() Dict[str, ClientProxy][源代码]#

Return all available clients.

abstract num_available() int[源代码]#

Return the number of available clients.

返回:

num_available -- The number of currently available clients.

返回类型:

int

abstract register(client: ClientProxy) bool[源代码]#

Register Flower ClientProxy instance.

参数:

client (flwr.server.client_proxy.ClientProxy) --

返回:

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

返回类型:

bool

abstract sample(num_clients: int, min_num_clients: int | None = None, criterion: Criterion | None = None) List[ClientProxy][源代码]#

Sample a number of Flower ClientProxy instances.

abstract unregister(client: ClientProxy) None[源代码]#

Unregister Flower ClientProxy instance.

This method is idempotent.

参数:

client (flwr.server.client_proxy.ClientProxy) --

abstract wait_for(num_clients: int, timeout: int) bool[源代码]#

Wait until at least num_clients are available.