def __init__(self, thread_pool, generic_handlers, options, maximum_concurrent_rpcs): completion_queue = cygrpc.CompletionQueue() server = cygrpc.Server(_common.channel_args(options)) server.register_completion_queue(completion_queue) self._state = _ServerState(completion_queue, server, generic_handlers, thread_pool, maximum_concurrent_rpcs)
def __init__(self, target, options=None, credentials=None): options = options if options is not None else () self.target = target self.channel = channel = cygrpc.Channel( _common.encode(target), _common.channel_args(_options(options)), credentials) self.managed_call = _channel_managed_call_management( _ChannelCallState(channel)) self.connectivity_state = _ChannelConnectivityState(channel)
def __init__(self, thread_pool, generic_handlers, options, exit_grace, exit_shutdown_handler_grace): completion_queue = cygrpc.CompletionQueue() server = cygrpc.Server(_common.channel_args(options)) server.register_completion_queue(completion_queue) self._state = _ServerState( completion_queue, server, generic_handlers, thread_pool, _DEFAULT_EXIT_GRACE if exit_grace is None else exit_grace, _DEFAULT_EXIT_SHUTDOWN_HANDLER_GRACE if exit_shutdown_handler_grace is None else exit_shutdown_handler_grace)
def __init__(self, target, options, credentials): """Constructor. Args: target: The target to which to connect. options: Configuration options for the channel. credentials: A cygrpc.ChannelCredentials or None. """ self._channel = cygrpc.Channel(_common.encode(target), _common.channel_args(_options(options)), credentials) self._call_state = _ChannelCallState(self._channel) self._connectivity_state = _ChannelConnectivityState(self._channel)
def __init__(self, target, options, credentials): """Constructor. Args: target: The target to which to connect. options: Configuration options for the channel. credentials: A cygrpc.ChannelCredentials or None. """ self._channel = cygrpc.Channel( _common.encode(target), _common.channel_args(_options(options)), credentials) self._call_state = _ChannelCallState(self._channel) self._connectivity_state = _ChannelConnectivityState(self._channel)
def __init__(self, target, options, credentials): """Constructor. Args: target: The target to which to connect. options: Configuration options for the channel. credentials: A cygrpc.ChannelCredentials or None. """ self._channel = cygrpc.Channel(_common.encode(target), _common.channel_args(_options(options)), credentials) self._call_state = _ChannelCallState(self._channel) self._connectivity_state = _ChannelConnectivityState(self._channel) # TODO(https://github.com/grpc/grpc/issues/9884) # Temporary work around UNAVAILABLE issues # Remove this once c-core has retry support _subscribe(self._connectivity_state, lambda *args: None, None)
def __init__(self, target, options, credentials): """Constructor. Args: target: The target to which to connect. options: Configuration options for the channel. credentials: A cygrpc.ChannelCredentials or None. """ self._channel = cygrpc.Channel( _common.encode(target), _common.channel_args(_options(options)), credentials) self._call_state = _ChannelCallState(self._channel) self._connectivity_state = _ChannelConnectivityState(self._channel) # TODO(https://github.com/grpc/grpc/issues/9884) # Temporary work around UNAVAILABLE issues # Remove this once c-core has retry support _subscribe(self._connectivity_state, lambda *args: None, None)