@@ -190,13 +190,13 @@ class ConnectionPool(ConnectionInterface):
190
190
ConnectionPool API is the same as a plain Connection API.
191
191
On each request, a connection is chosen to execute this request.
192
192
Connection is selected based on request mode:
193
+
193
194
* Mode.ANY chooses any instance.
194
195
* Mode.RW chooses an RW instance.
195
196
* Mode.RO chooses an RO instance.
196
- * Mode.PREFER_RW chooses an RW instance, if possible, RO instance
197
- otherwise.
198
- * Mode.PREFER_RO chooses an RO instance, if possible, RW instance
199
- otherwise.
197
+ * Mode.PREFER_RW chooses an RW instance, if possible, RO instance otherwise.
198
+ * Mode.PREFER_RO chooses an RO instance, if possible, RW instance otherwise.
199
+
200
200
All requests that are guaranteed to write (insert, replace, delete,
201
201
upsert, update) use RW mode by default. select uses ANY by default. You
202
202
can set the mode explicitly. call, eval, execute and ping requests
@@ -218,28 +218,39 @@ def __init__(self,
218
218
'''
219
219
Initialize connections to the cluster of servers.
220
220
221
- :param list addrs: List of {host: , port:} dictionaries,
222
- describing server addresses.
223
- :user str Username used to authenticate. User must be able
224
- to call box.info function. For example, to give grants to
225
- 'guest' user, evaluate
226
- box.schema.func.create('box.info')
227
- box.schema.user.grant('guest', 'execute', 'function', 'box.info')
228
- on Tarantool instances.
221
+ :param list addrs: List of
222
+
223
+ .. code-block:: python
224
+
225
+ { host: "str",
226
+ port: int,
227
+ transport: "str",
228
+ ssl_key_file: "str",
229
+ ssl_cert_file: "str",
230
+ ssl_ca_file: "str",
231
+ ssl_ciphers: "str" }
232
+
233
+ dictionaries, describing server addresses.
234
+ :param str user: Username used to authenticate. User must be able
235
+ to call box.info function. For example, to give grants to
236
+ 'guest' user, evaluate
237
+ box.schema.func.create('box.info')
238
+ box.schema.user.grant('guest', 'execute', 'function', 'box.info')
239
+ on Tarantool instances.
229
240
:param int reconnect_max_attempts: Max attempts to reconnect
230
- for each connection in the pool. Be careful with reconnect
231
- parameters in ConnectionPool since every status refresh is
232
- also a request with reconnection. Default is 0 (fail after
233
- first attempt).
241
+ for each connection in the pool. Be careful with reconnect
242
+ parameters in ConnectionPool since every status refresh is
243
+ also a request with reconnection. Default is 0 (fail after
244
+ first attempt).
234
245
:param float reconnect_delay: Time between reconnect
235
- attempts for each connection in the pool. Be careful with
236
- reconnect parameters in ConnectionPool since every status
237
- refresh is also a request with reconnection. Default is 0.
246
+ attempts for each connection in the pool. Be careful with
247
+ reconnect parameters in ConnectionPool since every status
248
+ refresh is also a request with reconnection. Default is 0.
238
249
:param StrategyInterface strategy_class: Class for choosing
239
- instance based on request mode. By default, round-robin
240
- strategy is used.
250
+ instance based on request mode. By default, round-robin
251
+ strategy is used.
241
252
:param int refresh_delay: Minimal time between RW/RO status
242
- refreshes.
253
+ refreshes.
243
254
'''
244
255
245
256
if not isinstance (addrs , list ) or len (addrs ) == 0 :
@@ -272,7 +283,12 @@ def __init__(self,
272
283
connect_now = False , # Connect in ConnectionPool.connect()
273
284
encoding = encoding ,
274
285
call_16 = call_16 ,
275
- connection_timeout = connection_timeout )
286
+ connection_timeout = connection_timeout ,
287
+ transport = addr ['transport' ],
288
+ ssl_key_file = addr ['ssl_key_file' ],
289
+ ssl_cert_file = addr ['ssl_cert_file' ],
290
+ ssl_ca_file = addr ['ssl_ca_file' ],
291
+ ssl_ciphers = addr ['ssl_ciphers' ])
276
292
)
277
293
278
294
if connect_now :
@@ -464,7 +480,7 @@ def ping(self, *, mode=None, **kwargs):
464
480
def select (self , space_name , key , * , mode = Mode .ANY , ** kwargs ):
465
481
'''
466
482
:param tarantool.Mode mode: Request mode (default is
467
- ANY).
483
+ ANY).
468
484
'''
469
485
470
486
return self ._send (mode , 'select' , space_name , key , ** kwargs )
0 commit comments