A async microservice framework for python
Project description
μService
A async microservice framework for Python. Inspired by FastAPI and Nameko. It uses the uvloop event loop instead of the default python asyncio loop.
Requirements
Python 3.10+
Example
from uservice import Service, EventPublisher, Depends
from typing import Annotated
from pydantic import BaseModel
class Payload(BaseModel):
foo: int
bar: str
publisher = EventPublisher()
service_a = Service(name="service_a")
@service_a.rpc()
def dispatch(
input: Payload,
publish: Annotated[Callable, Depends(publisher)],
):
publish("event", payload)
service_b = Service(name="service_b")
@service_b.event_handler("service_a", "event")
def handle(
payload: Payload,
):
print(payload)
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
uservice-0.1.0.tar.gz
(3.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
uservice-0.1.0-py3-none-any.whl
(16.1 kB
view details)
File details
Details for the file uservice-0.1.0.tar.gz.
File metadata
- Download URL: uservice-0.1.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.23.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b4c61718594025639905f9dc1ead4afbae6710393ae6269aa20672e3e1cb359
|
|
| MD5 |
aee36e8c9ac86bfac12fcbe2574cd1dc
|
|
| BLAKE2b-256 |
3be4d348f511eac84ec7e0dfbe2edf265a56cb48175b034233d3a9c8ea41eb22
|
File details
Details for the file uservice-0.1.0-py3-none-any.whl.
File metadata
- Download URL: uservice-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.23.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
786d7c237fcb49f039291d851106e19f7547dff668612d115d29045600fbd69e
|
|
| MD5 |
65dcfc8b7aeebeb3474638dffa995c72
|
|
| BLAKE2b-256 |
cfcf489768d2270dd51895ebd4aa6cedcd7aca9389c1fe59e5eff44deca227aa
|