ASGI server for amqp rpc protocol
Project description
Vilha
Rpc server inspired by nameko and aims to extend
asgi protocol to allow use of asgi middlewares and starlette
with DI inspired by FastAPI
Example
import asyncio
from vilha.server import Vilha
from vilha.starlette.applications import RpcRoute, Starlette
from vilha.di import Depends
import random
async def get_rnd():
return random.randint(0,100)
async def test_method(rnd: Annotated[int, Depends(get_rnd)]):
print("test_method")
return rnd
st = Starlette(routes=[RpcRoute("test_method", test_method)])
async def main():
await Vilha("test_service").run(st)
loop = asyncio.get_event_loop()
loop.create_task(main())
loop.run_forever()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vilha-0.0.2.tar.gz
(9.3 kB
view details)
Built Distribution
vilha-0.0.2-py3-none-any.whl
(14.6 kB
view details)
File details
Details for the file vilha-0.0.2.tar.gz
.
File metadata
- Download URL: vilha-0.0.2.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.10.5 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b143868e982639201913433ab13034a45695715a6994a30883113aa4dba21ff |
|
MD5 | 3b8102363cec9adaa14413941d2a8233 |
|
BLAKE2b-256 | 499a6571cd6078cd43cb92e7d530c8f9f66afb311ece950d7578615623be449f |
File details
Details for the file vilha-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: vilha-0.0.2-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.10.5 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c459b1b490331184e141f50d864ea8679f82668f5acdbccb4789e9353fd7b958 |
|
MD5 | 57c774d6571771e2ff1bb5fd4365919b |
|
BLAKE2b-256 | 427c021b16da79df34c613615372e79a15e38cf8019b90990e7fcb7a8700e115 |