Skip to main content

SSE adapter for Muscles streaming events

Project description

Muscles SSE

Server-Sent Events adapter for Muscles streaming use cases.

This package should provide progress, logs, notifications, and AI output streams over SSE while keeping the underlying workflow in the Muscles application model.

Related Repositories

Concept Guardrails

  • SSE streams must be backed by Muscles actions/events/jobs, not ad hoc handlers.
  • The adapter must preserve shared rules/security and request context.
  • Stream events must have typed names and payload schemas.
  • SSE should be the simple default for one-way streaming before WebSocket is introduced.
  • The package must be usable from ASGI without forcing unrelated runtime choices.

Current Stage (Issue #1)

Implemented SSE transport projection over Muscles action execution:

  • action dispatch path: dispatcher.execute(action, payload, transport="sse");
  • application facade: SseAdapter.from_application(app) backed by core ActionDispatcher;
  • stream normalization delegates to core stream_events() / StreamResult;
  • typed events: progress, log, result, error;
  • wire formatting: id, event, retry, data;
  • SseResponse with SSE headers and status;
  • heartbeat policy (optional);
  • safe source close on stream completion/disconnect;
  • structured core action error mapping: not found, validation, permission, execution.

This keeps SSE as a thin delivery layer. Business logic stays in Muscles actions.

Run tests

python -m pytest -q

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

muscles_sse-1.0.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

muscles_sse-1.0.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file muscles_sse-1.0.1.tar.gz.

File metadata

  • Download URL: muscles_sse-1.0.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for muscles_sse-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c1d96abc2bc22f90f687ec2f7d8deeca85fa4c4b78b4f478167c7c5d4e47c470
MD5 72ba4a69e24512561b035ca92be8bcf2
BLAKE2b-256 da916a2ae08c842c9868ec2d8a15ff014c863f2a480cb830cfe814fc57d29b37

See more details on using hashes here.

Provenance

The following attestation bundles were made for muscles_sse-1.0.1.tar.gz:

Publisher: release.yml on butkoden/muscles-sse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file muscles_sse-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: muscles_sse-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for muscles_sse-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f18309d8781947ad993a506205ac114e41fb81b76691f4306bb50b6124aa9745
MD5 cfd9ed7aa636702242965ee1e72e1d18
BLAKE2b-256 fc75baebd8955eca10f8ba4acd0c05e700d278275a4d82ba40375d9140ef1305

See more details on using hashes here.

Provenance

The following attestation bundles were made for muscles_sse-1.0.1-py3-none-any.whl:

Publisher: release.yml on butkoden/muscles-sse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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