Skip to main content

Lightweight, efficient and developer-friendly framework for component communication

Project description

drawing

FastCC

Ruff Mypy Gitmoji

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastcc-2.1.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

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

Hashes for fastcc-2.1.0.tar.gz
Algorithm Hash digest
SHA256 00a80d46ebdf3cf3ca40329f155319779203a7ab9180421a02117638f4b8be37
MD5 6719a2b44fe345e65f27445cce9c22a0
BLAKE2b-256 bbbabc0948b8fd95478224aeaac47355b2d7fc1591dc414cceb1095212d30ca2

See more details on using hashes here.

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

Hashes for fastcc-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a7e1afee8a0642d19d1ebf17b17d78aaf8bbbf0fba24eb370d0c655b1adfe305
MD5 bac221a2cc6967d761b1a05cdae51864
BLAKE2b-256 ed638e4f310539e8bdb6ae6349ffd58738152c280b3bce25257d432181d13c16

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page