Lightweight, efficient and developer-friendly framework for component communication
Project description
FastCC
Framework for component communication with MQTT and Protocol Buffers :boom:.
- Lightweight :zap:
- Efficient :rocket:
- Developer-friendly :technologist:
This framework is built on top of empicano's aiomqtt.
Example
import asyncio
import contextlib
import logging
import os
import sys
import typing
import fastcc
router = fastcc.Router()
@router.route("example")
async def example(name: str, *, database: dict[str, typing.Any]) -> str:
database[name] = 1
print(database)
return f"Hello, {name}!"
async def main() -> None:
logging.basicConfig(level=logging.INFO)
database: dict[str, typing.Any] = {}
mqtt_client = fastcc.Client("test.mosquitto.org")
app = fastcc.FastCC(mqtt_client)
app.add_router(router)
app.add_injector(database=database)
async with mqtt_client:
await app.run()
# https://github.com/empicano/aiomqtt?tab=readme-ov-file#note-for-windows-users
if sys.platform.lower() == "win32" or os.name.lower() == "nt":
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
with contextlib.suppress(KeyboardInterrupt):
asyncio.run(main())
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
fastcc-2.0.0.tar.gz
(11.0 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
fastcc-2.0.0-py3-none-any.whl
(11.5 kB
view details)
File details
Details for the file fastcc-2.0.0.tar.gz.
File metadata
- Download URL: fastcc-2.0.0.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04fef6161329f6d59697f95452be82a91ed8a6e84c97796abb8a3b9af1b60052
|
|
| MD5 |
70e7ed646fcb06c177631c7c75b6867f
|
|
| BLAKE2b-256 |
6c550758bcfe1e1f58618f4057d63292c403fb60e417f6558d7dce1b1eec6c56
|
File details
Details for the file fastcc-2.0.0-py3-none-any.whl.
File metadata
- Download URL: fastcc-2.0.0-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
412e87fc96d234da79e60bfb5685a9333a6bcdf2254ce9520214cf8216bc73f0
|
|
| MD5 |
7a234cda8ee81a58f948b56448ae01a7
|
|
| BLAKE2b-256 |
b120ca6972bd2921b1f514a75dd624914fe33d0a30452b2d6fec726f47c933e0
|