sift_py.grpc.keepalive

 1from typing import TypedDict
 2
 3DEFAULT_KEEPALIVE_TIME_MS = 20_000
 4"""Interval with which to send keepalive pings"""
 5
 6DEFAULT_KEEPALIVE_TIMEOUT_MS = 20_000
 7"""Timeout while waiting for server to acknowledge keepalive ping"""
 8
 9DEFAULT_KEEPALIVE_PERMIT_WITHOUT_CALLS = 1
10"""Allows connection without any active RPCs"""
11
12DEFAULT_MAX_PINGS_WITHOUT_DATA = 0
13"""Disabled"""
14
15
16# https://github.com/grpc/grpc/blob/master/doc/keepalive.md
17class KeepaliveConfig(TypedDict):
18    """
19    Make make this public in the future to allow folks to configure their own keepalive settings
20    if there is demand for it.
21    """
22
23    keepalive_time_ms: int
24    keepalive_timeout_ms: int
25    keepalive_permit_without_calls: int
26    max_pings_without_data: int
27
28
29DEFAULT_KEEPALIVE_CONFIG: KeepaliveConfig = {
30    "keepalive_time_ms": DEFAULT_KEEPALIVE_TIME_MS,
31    "keepalive_timeout_ms": DEFAULT_KEEPALIVE_TIMEOUT_MS,
32    "keepalive_permit_without_calls": DEFAULT_KEEPALIVE_PERMIT_WITHOUT_CALLS,
33    "max_pings_without_data": DEFAULT_MAX_PINGS_WITHOUT_DATA,
34}
DEFAULT_KEEPALIVE_TIME_MS = 20000

Interval with which to send keepalive pings

DEFAULT_KEEPALIVE_TIMEOUT_MS = 20000

Timeout while waiting for server to acknowledge keepalive ping

DEFAULT_KEEPALIVE_PERMIT_WITHOUT_CALLS = 1

Allows connection without any active RPCs

DEFAULT_MAX_PINGS_WITHOUT_DATA = 0

Disabled

class KeepaliveConfig(builtins.dict):
18class KeepaliveConfig(TypedDict):
19    """
20    Make make this public in the future to allow folks to configure their own keepalive settings
21    if there is demand for it.
22    """
23
24    keepalive_time_ms: int
25    keepalive_timeout_ms: int
26    keepalive_permit_without_calls: int
27    max_pings_without_data: int

Make make this public in the future to allow folks to configure their own keepalive settings if there is demand for it.

keepalive_time_ms: int
keepalive_timeout_ms: int
keepalive_permit_without_calls: int
max_pings_without_data: int
Inherited Members
builtins.dict
get
setdefault
pop
popitem
keys
items
values
update
fromkeys
clear
copy
DEFAULT_KEEPALIVE_CONFIG: KeepaliveConfig = {'keepalive_time_ms': 20000, 'keepalive_timeout_ms': 20000, 'keepalive_permit_without_calls': 1, 'max_pings_without_data': 0}