[Router] Add a rust-based router (#1790)

This commit is contained in:
Byron Hsu
2024-10-28 09:49:48 -07:00
committed by GitHub
parent 6e13b650a9
commit 3839be2913
8 changed files with 2666 additions and 0 deletions

17
rust/test_bindings.py Normal file
View File

@@ -0,0 +1,17 @@
import router
# Create a Router instance with:
# - host: the address to bind to (e.g., "127.0.0.1")
# - port: the port number (e.g., 3001)
# - worker_urls: list of worker URLs to distribute requests to
router = router.Router(
host="127.0.0.1",
port=3001,
worker_urls=[
"http://localhost:30000",
"http://localhost:30002",
],
)
# Start the router - this will block and run the server
router.start()