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.1.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.1.0-py3-none-any.whl
(11.2 kB
view details)
File details
Details for the file fastcc-2.1.0.tar.gz.
File metadata
- Download URL: fastcc-2.1.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 |
00a80d46ebdf3cf3ca40329f155319779203a7ab9180421a02117638f4b8be37
|
|
| MD5 |
6719a2b44fe345e65f27445cce9c22a0
|
|
| BLAKE2b-256 |
bbbabc0948b8fd95478224aeaac47355b2d7fc1591dc414cceb1095212d30ca2
|
File details
Details for the file fastcc-2.1.0-py3-none-any.whl.
File metadata
- Download URL: fastcc-2.1.0-py3-none-any.whl
- Upload date:
- Size: 11.2 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 |
a7e1afee8a0642d19d1ebf17b17d78aaf8bbbf0fba24eb370d0c655b1adfe305
|
|
| MD5 |
bac221a2cc6967d761b1a05cdae51864
|
|
| BLAKE2b-256 |
ed638e4f310539e8bdb6ae6349ffd58738152c280b3bce25257d432181d13c16
|