MCPcopy
hub / github.com/psycopg/psycopg / open

Method open

psycopg_pool/psycopg_pool/pool.py:374–392  ·  view source on GitHub ↗

Open the pool by starting connecting and and accepting clients. If *wait* is `!False`, return immediately and let the background worker fill the pool if `min_size` > 0. Otherwise wait up to *timeout* seconds for the requested number of connections to be ready (see `wait()` f

(self, wait: bool = False, timeout: float = 30.0)

Source from the content-addressed store, hash-verified

372 return True
373
374 def open(self, wait: bool = False, timeout: float = 30.0) -> None:
375 """Open the pool by starting connecting and and accepting clients.
376
377 If *wait* is `!False`, return immediately and let the background worker
378 fill the pool if `min_size` > 0. Otherwise wait up to *timeout* seconds
379 for the requested number of connections to be ready (see `wait()` for
380 details).
381
382 It is safe to call `!open()` again on a pool already open (because the
383 method was already called, or because the pool context was entered, or
384 because the pool was initialized with *open* = `!True`) but you cannot
385 currently re-open a closed pool.
386 """
387
388 with self._lock:
389 self._open()
390
391 if wait:
392 self.wait(timeout=timeout)
393
394 def _open(self) -> None:
395 if not self._closed:

Callers 15

__enter__Method · 0.95
test_del_no_warningFunction · 0.95
test_open_waitFunction · 0.95
_update_history_fileMethod · 0.45
_get_changes_linesMethod · 0.45
convertFunction · 0.45
update_fileFunction · 0.45
test_multiprocess_closeFunction · 0.45

Calls 2

_openMethod · 0.95
waitMethod · 0.95

Tested by 15

test_del_no_warningFunction · 0.76
test_open_waitFunction · 0.76
test_multiprocess_closeFunction · 0.36
test_trace_pre14Function · 0.36
test_traceFunction · 0.36
test_open_as_waitFunction · 0.36
testFunction · 0.36
test_open_as_waitFunction · 0.36
test_create_warningFunction · 0.36
test_closed_getconnFunction · 0.36