Configuration

Channel and Server classes accepts configuration via Configuration object to modify default behaviour.

Example:

from grpclib.config import Configuration

config = Configuration(
    http2_connection_window_size=2**20,  # 1 MiB
)
channel = Channel('localhost', 50051, config=config)

Reference

class grpclib.config.Configuration(_keepalive_time: Union[float, NoneType] = <default>, _keepalive_timeout: float = 20.0, _keepalive_permit_without_calls: bool = False, _http2_max_pings_without_data: int = 2, _http2_min_sent_ping_interval_without_data: float = 300, http2_connection_window_size: int = 4194304, http2_stream_window_size: int = 4194304, ssl_target_name_override: Union[str, NoneType] = None)
http2_connection_window_size: int = 4194304

Sets inbound window size for a connection. HTTP/2 spec allows this value to be from 64 KiB to 2 GiB, 4 MiB is used by default

http2_stream_window_size: int = 4194304

Sets inbound window size for a stream. HTTP/2 spec allows this value to be from 64 KiB to 2 GiB, 4 MiB is used by default

ssl_target_name_override: Optional[str] = None

NOTE: This should be used for testing only. Overrides the hostname that the target server’s certificate will be matched against. By default, the value of the host argument is used.