Skip to content

src/dazzle_back/events/consumer.py

Generated: 2026-03-30T04:38:46.025127+00:00

Commit: 615f1354a103

Language: python

Scope: dazzle_back

Purpose

Idempotent Consumer Wrapper for Event Handlers.

This module provides decorators and wrappers that make event handlers idempotent by automatically checking the inbox before processing and marking events as processed after successful handling.

Rule 2: At-least-once delivery is assumed; consumers mus...

Key Exports

  • ConsumerConfig
  • ConsumerStats
  • IdempotentConsumer
  • idempotent
  • ConsumerGroup
  • stats
  • consumer_name
  • connect
  • close
  • handler
  • process
  • get_status
  • decorator
  • group_id
  • add
  • get
  • start_all
  • stop_all
  • get_status
  • wrapper

Dependencies

Imports

  • __future__.annotations
  • logging
  • collections.abc.Awaitable
  • collections.abc.Callable
  • dataclasses.dataclass
  • dataclasses.field
  • datetime.UTC
  • datetime.datetime
  • functools.wraps
  • typing.Any
  • typing.TypeVar
  • dazzle_back.events.bus.EventBus
  • dazzle_back.events.bus.NackReason
  • dazzle_back.events.envelope.EventEnvelope
  • dazzle_back.events.inbox.EventInbox
  • dazzle_back.events.inbox.ProcessingResult

Event Interactions

None detected.

Invariants and Assumptions

  • Validates: connect is required
  • Assert: self._conn is not None

Tests

  • tests/unit/test_events.py
  • tests/unit/test_events_api.py

Notes

This page was automatically generated by tools/gen_reference_docs.py.