Coverage for Lib/asyncio/constants.py: 100%
14 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-15 02:02 +0000
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-15 02:02 +0000
1# Contains code from https://github.com/MagicStack/uvloop/tree/v0.16.0
2# SPDX-License-Identifier: PSF-2.0 AND (MIT OR Apache-2.0)
3# SPDX-FileCopyrightText: Copyright (c) 2015-2021 MagicStack Inc. http://magic.io
5import enum
7# After the connection is lost, log warnings after this many write()s.
8LOG_THRESHOLD_FOR_CONNLOST_WRITES = 5
10# Seconds to wait before retrying accept().
11ACCEPT_RETRY_DELAY = 1
13# Number of stack entries to capture in debug mode.
14# The larger the number, the slower the operation in debug mode
15# (see extract_stack() in format_helpers.py).
16DEBUG_STACK_DEPTH = 10
18# Number of seconds to wait for SSL handshake to complete
19# The default timeout matches that of Nginx.
20SSL_HANDSHAKE_TIMEOUT = 60.0
22# Number of seconds to wait for SSL shutdown to complete
23# The default timeout mimics lingering_time
24SSL_SHUTDOWN_TIMEOUT = 30.0
26# Used in sendfile fallback code. We use fallback for platforms
27# that don't support sendfile, or for TLS connections.
28SENDFILE_FALLBACK_READBUFFER_SIZE = 1024 * 256
30FLOW_CONTROL_HIGH_WATER_SSL_READ = 256 # KiB
31FLOW_CONTROL_HIGH_WATER_SSL_WRITE = 512 # KiB
33# Default timeout for joining the threads in the threadpool
34THREAD_JOIN_TIMEOUT = 300
36# The enum should be here to break circular dependencies between
37# base_events and sslproto
38class _SendfileMode(enum.Enum):
39 UNSUPPORTED = enum.auto()
40 TRY_NATIVE = enum.auto()
41 FALLBACK = enum.auto()