Commit 2821566 1 parent 076a014 commit 2821566 Copy full SHA for 2821566
File tree 4 files changed +27
-3
lines changed
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 38
38
)
39
39
40
40
from 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
42
43
from pymongo .asynchronous .client_session import _validate_session_write_concern
43
44
from pymongo .asynchronous .helpers import _handle_reauth
44
45
from pymongo .asynchronous .network import command , receive_message
Original file line number Diff line number Diff line change 31
31
from OpenSSL import SSL as _SSL
32
32
from OpenSSL import crypto as _crypto
33
33
34
- from pymongo import _PYMONGO_EXECUTOR
34
+ from pymongo . _asyncio_executor import _PYMONGO_EXECUTOR
35
35
from pymongo .errors import ConfigurationError as _ConfigurationError
36
36
from pymongo .errors import _CertificateError # type:ignore[attr-defined]
37
37
from pymongo .ocsp_cache import _OCSPCache
Original file line number Diff line number Diff line change 38
38
)
39
39
40
40
from 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
42
43
from pymongo .common import (
43
44
MAX_BSON_SIZE ,
44
45
MAX_MESSAGE_SIZE ,
You can’t perform that action at this time.
0 commit comments