Skip to main content

taskferry-events

Portable pub/sub and fan-out event delivery. Ships alongside Taskferry, the portable execution layer. Plain Python, no Django required.

An Event declares that something happened and may have zero or more consumers — the opposite of a Task, which is one operation to run. Modeled on CloudEvents.

pip install taskferry-events            # in-memory bus
pip install taskferry-events[gcp]       # + Google Cloud Pub/Sub

Usage

from taskferry_events import Event, publishers

publishers["default"].publish(
    Event(type="file.uploaded", source="urn:svc:uploads", data={"file_id": "42"})
)

Fan-out with the in-process bus:

from taskferry_events import InMemoryEventBus, Event

bus = InMemoryEventBus()
bus.subscribe(lambda e: print("billing", e.data), event_type="order.placed")
bus.subscribe(lambda e: print("analytics", e.data))  # sees everything
bus.publish(Event(type="order.placed", source="urn:shop", data={"total": 10}))

Configure a provider publisher (lazy — no SDK imported until first use):

from taskferry_events import publishers

publishers.configure(
    {
        "default": {
            "factory": "taskferry_events.adapters.gcp:make_pubsub_publisher",
            "project": "my-proj",
            "topic": "domain-events",
            "ordering": True,
        },
    }
)

Task vs Event

Task  → one operation to execute       (~1 consumer)
Event → a fact that happened           (0..N consumers, fan-out)

Capabilities

Adapters advertise what they support (fanout, ordering, delivery_retry, dead_letter, filtering, replay, retention). Requesting replay on a backend that lacks it raises UnsupportedCapabilityError.

Adapter Provider Capabilities
InMemoryEventBus inmemory fanout, filtering, replay, retention
PubSubPublisher gcp fanout, delivery_retry, dead_letter, filtering, retention (+ ordering)
SnsPublisher aws fanout, delivery_retry, dead_letter, filtering (+ ordering on FIFO)
EventBridgePublisher aws fanout, delivery_retry, dead_letter, filtering, retention, replay
EventGridPublisher azure fanout, delivery_retry, dead_letter, filtering, retention
KafkaPublisher kafka fanout, ordering, delivery_retry, retention, replay

Roadmap: NATS, RabbitMQ.

Delivery semantics

At-least-once with possible duplicates (ADR-0010). Consumers must be idempotent.

License

Apache-2.0.

Release files for taskferry-events 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for taskferry-events 0.2.0
File Size Uploaded
taskferry_events-0.2.0.tar.gz 13.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for taskferry-events 0.2.0
File Interpreter ABI Platform
taskferry_events-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 33.9 kB

Release files / taskferry_events-0.2.0.tar.gz

Download URL taskferry_events-0.2.0.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
64fbef7fe14e07130e58c7403f7d2254be780364db4d0ec9e3905c097eef7583
BLAKE2b-256 checksum
How to use checksums
f871f5ce02dfbf1050f8a19bb9a6cdd0a6dcd96128a3e35fb94d9515d63cc4aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

Release files / taskferry_events-0.2.0-py3-none-any.whl

Download URL taskferry_events-0.2.0-py3-none-any.whl
Size 20.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d84fd7b9a855b2c83d68f00667798a31222fc3269434f482ca91d8aadaec193
BLAKE2b-256 checksum
How to use checksums
a66bec269a343ec487157b0379f2a464874b6a0bac5948111ec6e40eebbabefc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.0

2 release files

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page