Skip to main content

A Python package for deploying stateful loops

Project description

FastLoop

A Python package for building and deploying stateful loops.

Installation

pip install fastloop

Usage

Basic Example

from fastloop import FastLoop, LoopContext, LoopEvent

app = FastLoop(name="my-app")

@app.event("start")
class StartEvent(LoopEvent):
    user_id: str
    message: str

@app.loop(name="chat", start_event=StartEvent)
async def chat_loop(context: LoopContext):
    # Get the initial event
    start_event = await context.wait_for(StartEvent)
    print(f"User {start_event.user_id} started chat: {start_event.message}")
    
    # Your loop logic here
    context.stop()

if __name__ == "__main__":
    app.run(port=8000)

Development

This project uses uv for dependency management.

# Install dependencies
uv sync

# Run tests
uv run pytest

# Build package
uv build

License

[Add your license here]

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

fastloop-0.1.14.tar.gz (83.1 kB view details)

Uploaded Source

Built Distribution

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

fastloop-0.1.14-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file fastloop-0.1.14.tar.gz.

File metadata

  • Download URL: fastloop-0.1.14.tar.gz
  • Upload date:
  • Size: 83.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for fastloop-0.1.14.tar.gz
Algorithm Hash digest
SHA256 04aa9e7da25f034309b318d2c777f63ef803fad355e3abae9d5ecc22ac37c980
MD5 d806e9bcef111d78abdd9c946a335a65
BLAKE2b-256 9dd0279f9b216c82a1619266275b5fb88eae95f8506fb48494ec13aab6cc80a6

See more details on using hashes here.

File details

Details for the file fastloop-0.1.14-py3-none-any.whl.

File metadata

  • Download URL: fastloop-0.1.14-py3-none-any.whl
  • Upload date:
  • Size: 21.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for fastloop-0.1.14-py3-none-any.whl
Algorithm Hash digest
SHA256 5dede1f0c60bce68e00ab9e183b2bdd213a343d1a386b07b2bb4cfdb8ac4d483
MD5 0d14c51f9b0553fdf4b6ac215bfee678
BLAKE2b-256 5b6b893d98953ed9192c2f58ea825533b3aaee1736048af9a7375caa2875a855

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