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))
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
def generate_configs(num_replicas: Optional[int] = 1 ) -> Tuple[BackendConfig, ReplicaConfig]: return BackendConfig(num_replicas=num_replicas), ReplicaConfig(lambda x: x)