示例#1
0
def backend_info(version: Optional[str] = None,
                 num_replicas: Optional[int] = 1,
                 **config_opts) -> BackendInfo:
    return BackendInfo(actor_def=None,
                       version=version,
                       backend_config=BackendConfig(num_replicas=num_replicas,
                                                    **config_opts),
                       replica_config=ReplicaConfig(lambda x: x))
示例#2
0
def generate_mock_backend_info(
        num_replicas: Optional[int] = None) -> BackendInfo:
    backend_info = BackendInfo(worker_class=lambda x: x,
                               backend_config=BackendConfig(),
                               replica_config=ReplicaConfig(lambda x: x))
    if num_replicas:
        backend_info.backend_config.num_replicas = num_replicas

    return backend_info
示例#3
0
def generate_configs(num_replicas: Optional[int] = 1
                     ) -> Tuple[BackendConfig, ReplicaConfig]:
    return BackendConfig(num_replicas=num_replicas), ReplicaConfig(lambda x: x)