File tree Expand file tree Collapse file tree 4 files changed +27
-3
lines changed
Expand file tree Collapse file tree 4 files changed +27
-3
lines changed Original file line number Diff line number Diff line change 1+ # Copyright 2024-present MongoDB, Inc.
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ """A separate ThreadPoolExecutor instance used internally to avoid competing for resources with the default asyncio ThreadPoolExecutor
16+ that user code will use."""
17+
18+ from __future__ import annotations
19+
20+ from concurrent .futures import ThreadPoolExecutor
21+
22+ _PYMONGO_EXECUTOR = ThreadPoolExecutor (thread_name_prefix = "PYMONGO_EXECUTOR-" )
Original file line number Diff line number Diff line change 3838)
3939
4040from bson import DEFAULT_CODEC_OPTIONS
41- from pymongo import _PYMONGO_EXECUTOR , _csot , helpers_shared
41+ from pymongo import _csot , helpers_shared
42+ from pymongo ._asyncio_executor import _PYMONGO_EXECUTOR
4243from pymongo .asynchronous .client_session import _validate_session_write_concern
4344from pymongo .asynchronous .helpers import _handle_reauth
4445from pymongo .asynchronous .network import command , receive_message
Original file line number Diff line number Diff line change 3131from OpenSSL import SSL as _SSL
3232from OpenSSL import crypto as _crypto
3333
34- from pymongo import _PYMONGO_EXECUTOR
34+ from pymongo . _asyncio_executor import _PYMONGO_EXECUTOR
3535from pymongo .errors import ConfigurationError as _ConfigurationError
3636from pymongo .errors import _CertificateError # type:ignore[attr-defined]
3737from pymongo .ocsp_cache import _OCSPCache
Original file line number Diff line number Diff line change 3838)
3939
4040from bson import DEFAULT_CODEC_OPTIONS
41- from pymongo import _PYMONGO_EXECUTOR , _csot , helpers_shared
41+ from pymongo import _csot , helpers_shared
42+ from pymongo ._asyncio_executor import _PYMONGO_EXECUTOR
4243from pymongo .common import (
4344 MAX_BSON_SIZE ,
4445 MAX_MESSAGE_SIZE ,
You can’t perform that action at this time.
0 commit comments