Skip to content

Commit 00f56de

Browse files
committed
add doc
Signed-off-by: yaommen <myanstu@163.com>
1 parent b50eebc commit 00f56de

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

doc/source/serve/doc_code/asyncio_best_practices.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,13 @@ async def __call__(self, request):
344344
result = cpu_threadpool_handle.remote(None).result()
345345
print(f"CPUWithThreadpool result: {result}")
346346
assert result == "ok"
347-
347+
348+
print("\nTesting CustomThreadPool deployment...")
349+
custom_threadpool_handle = serve.run(CustomThreadPool.bind())
350+
result = custom_threadpool_handle.remote(None).result()
351+
print(f"CustomThreadPool result: {result}")
352+
assert result == "ok"
353+
348354
print("\nTesting BlockingStream deployment...")
349355
# Test BlockingStream - just verify it can be created and called
350356
blocking_stream_handle = serve.run(BlockingStream.bind())
@@ -402,7 +408,7 @@ async def __call__(self, request):
402408
print("✅ ThreadedHTTP test passed")
403409
except Exception as e:
404410
print(f"⚠️ ThreadedHTTP test failed (expected): {type(e).__name__}: {e}")
405-
411+
406412
print("\nTesting OffloadIO deployment...")
407413
try:
408414
offload_io_handle = serve.run(OffloadIO.bind())

0 commit comments

Comments
 (0)