@@ -92,10 +92,10 @@ def __init__(
92
92
headers : Optional [HeadersLike ] = None ,
93
93
ssl : Union [SSLContext , bool ] = False ,
94
94
init_payload : Dict [str , Any ] = {},
95
- connect_timeout : int = 10 ,
96
- close_timeout : int = 10 ,
97
- ack_timeout : int = 10 ,
98
- keep_alive_timeout : Optional [int ] = None ,
95
+ connect_timeout : Optional [ Union [ int , float ]] = 10 ,
96
+ close_timeout : Optional [ Union [ int , float ]] = 10 ,
97
+ ack_timeout : Optional [ Union [ int , float ]] = 10 ,
98
+ keep_alive_timeout : Optional [Union [ int , float ] ] = None ,
99
99
connect_args : Dict [str , Any ] = {},
100
100
) -> None :
101
101
"""Initialize the transport with the given parameters.
@@ -105,10 +105,11 @@ def __init__(
105
105
:param ssl: ssl_context of the connection. Use ssl=False to disable encryption
106
106
:param init_payload: Dict of the payload sent in the connection_init message.
107
107
:param connect_timeout: Timeout in seconds for the establishment
108
- of the websocket connection.
109
- :param close_timeout: Timeout in seconds for the close.
108
+ of the websocket connection. If None is provided this will wait forever.
109
+ :param close_timeout: Timeout in seconds for the close. If None is provided
110
+ this will wait forever.
110
111
:param ack_timeout: Timeout in seconds to wait for the connection_ack message
111
- from the server.
112
+ from the server. If None is provided this will wait forever.
112
113
:param keep_alive_timeout: Optional Timeout in seconds to receive
113
114
a sign of liveness from the server.
114
115
:param connect_args: Other parameters forwarded to websockets.connect
@@ -118,9 +119,9 @@ def __init__(
118
119
self .headers : Optional [HeadersLike ] = headers
119
120
self .init_payload : Dict [str , Any ] = init_payload
120
121
121
- self .connect_timeout : int = connect_timeout
122
- self .close_timeout : int = close_timeout
123
- self .ack_timeout : int = ack_timeout
122
+ self .connect_timeout : Optional [ Union [ int , float ]] = connect_timeout
123
+ self .close_timeout : Optional [ Union [ int , float ]] = close_timeout
124
+ self .ack_timeout : Optional [ Union [ int , float ]] = ack_timeout
124
125
self .keep_alive_timeout : Optional [int ] = keep_alive_timeout
125
126
126
127
self .connect_args = connect_args
0 commit comments