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.0.tar.gz (6.4 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.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: muscles_sse-1.0.0.tar.gz
  • Upload date:
  • Size: 6.4 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.0.tar.gz
Algorithm Hash digest
SHA256 17ae337ab915de181a773a3bffe8fea694e6e554958306b01d1b5f289ae97c13
MD5 3430bff0b2b7bd43429786268800512e
BLAKE2b-256 27b67921d86d5e8fa1a75cacc426edadacf02b019a57c848dc196a6f49ce0f1b

See more details on using hashes here.

Provenance

The following attestation bundles were made for muscles_sse-1.0.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: muscles_sse-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 82998ff45e9657dd5f4311508ced0a80e63bc71aa1d6ed62b0e10f780aece362
MD5 d64a16a0ca95468d70773cd320ebe01c
BLAKE2b-256 db8a29c8bd9944fa32171c925d4553fa9ef1255297f577e92a33daa328941ce0

See more details on using hashes here.

Provenance

The following attestation bundles were made for muscles_sse-1.0.0-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