A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 14, 05:30 UTC
Fix forward reference warning in documentation (#25150)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Harry Mellor committed
Sep 18, 2025 at 12:41 UTC
5a33ae9a3faae79cad9d2659862fcd8d86483659
1 file changed
+13
-13
vllm/engine/async_timeout.py
+13
-13
@@ -16,19 +16,6 @@ if sys.version_info[:2] >= (3, 11):
16
from asyncio import timeout as asyncio_timeout
17
else:
18
19
- def asyncio_timeout(delay: Optional[float]) -> "Timeout":
20
- """timeout context manager.
21
- Useful in cases when you want to apply timeout logic around block
22
- of code or in cases when asyncio.wait_for is not suitable. For example:
23
- >>> async with timeout(0.001):
24
- ... async with aiohttp.get('https://github.com') as r:
25
- ... await r.text()
26
- delay - value in seconds or None to disable timeout logic
27
- """
28
- loop = asyncio.get_running_loop()
29
- deadline = loop.time() + delay if delay is not None else None
30
- return Timeout(deadline, loop)
31
-
19
class _State(enum.Enum):
20
INIT = "INIT"
21
ENTER = "ENTER"
@@ -171,3 +158,16 @@ else:
158
self._state = _State.TIMEOUT
159
# drop the reference early
160
self._timeout_handler = None
161
+
162
+ def asyncio_timeout(delay: Optional[float]) -> Timeout:
163
+ """timeout context manager.
164
+ Useful in cases when you want to apply timeout logic around block
165
+ of code or in cases when asyncio.wait_for is not suitable. For example:
166
+ >>> async with timeout(0.001):
167
+ ... async with aiohttp.get('https://github.com') as r:
168
+ ... await r.text()
169
+ delay - value in seconds or None to disable timeout logic
170
+ """
171
+ loop = asyncio.get_running_loop()
172
+ deadline = loop.time() + delay if delay is not None else None
173
+ return Timeout(deadline, loop)