Skip to content

declearn.main.config.RegisterConfig

Dataclass wrapping parameters for clients' registration.

The parameters wrapped by this class are those of declearn.communication.Server.wait_for_clients.

Attributes:

Name Type Description
min_clients int

Minimum number of clients required. Corrected to be >= 1. If timeout is None, used as the exact number of clients required - once reached, registration will be closed.

max_clients int or None

Maximum number of clients authorized to register.

timeout int or None

Optional maximum waiting time (in seconds) beyond which to close registration and either return or raise.

Source code in declearn/main/config/_dataclasses.py
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
@dataclasses.dataclass
class RegisterConfig:
    """Dataclass wrapping parameters for clients' registration.

    The parameters wrapped by this class are those of
    `declearn.communication.Server.wait_for_clients`.

    Attributes
    ----------
    min_clients: int
        Minimum number of clients required. Corrected to be >= 1.
        If `timeout` is None, used as the exact number of clients
        required - once reached, registration will be closed.
    max_clients: int or None
        Maximum number of clients authorized to register.
    timeout: int or None
        Optional maximum waiting time (in seconds) beyond which
        to close registration and either return or raise.
    """

    min_clients: int = 1
    max_clients: Optional[int] = None
    timeout: Optional[int] = None