File: global_context.rst

package info (click to toggle)
python-pyproj 3.7.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,720 kB
  • sloc: python: 13,468; sh: 273; makefile: 90
file content (25 lines) | stat: -rw-r--r-- 758 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.. _global_context:

Global Context
==============

.. deprecated:: 3.7.0 No longer necessary as there is only one context per thread now.

If you have a single-threaded application that generates many objects,
enabling the use of the global context can provide performance enhancements.

.. warning:: The global context is not thread safe.
.. warning:: The global context maintains a connection to the database
             through the duration of each python session and is closed
             once the program terminates.

How to enable:

- Using :func:`pyproj.set_use_global_context`.
- Using the environment variable `PYPROJ_GLOBAL_CONTEXT`.


pyproj.set_use_global_context
-----------------------------

.. autofunction:: pyproj.set_use_global_context