Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/reliable-reporting-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,18 @@ the buyer runs.
Under `max_accounts`, accounts already served keep their slots and the rest are
filled in `account_id` byte order; the remainder get a `capacity` exception.

**Engine state.** The engine keeps each principal's state (grants and losses,
timezone changes, every version's configuration and destination snapshot,
`max_accounts` slots, exceptions and withheld counts) as one JSON document in a
`ReportingSubscriptionStateStore`, written by compare-and-swap. On a conflicting
concurrent write it reloads and reapplies the change, and it raises
`ReportingSubscriptionStateConflictError` if the document keeps changing. The
default `InMemoryReportingSubscriptionStore` is lost on restart; pass a durable
`store=` in production, and share it, with the `PrincipalService` record store,
across every worker. Version configurations are never pruned, so
`prior_versions` stay answerable while obligations cite them; exceptions are
dropped `status_retention_days` after they close.

`subscription_capabilities(...)` and `advertise_reporting_subscriptions(...)`
project `configuration_tasks`, the deprecated `configuration_task`, the
`subscriptions` block, the feature id and the principal section. The engine
Expand Down
10 changes: 10 additions & 0 deletions src/adcp/reporting/subscriptions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@
ReportingSubscriptionEngine,
ReportingSubscriptionHost,
ReportingSubscriptionPrecedenceHost,
ReportingSubscriptionStateConflictError,
ReportingSubscriptionStateStore,
StoredReportingSubscriptionState,
decode_principal_state,
encode_principal_state,
)
from adcp.reporting.subscriptions.registry import (
ReportingSubscriptionError,
Expand Down Expand Up @@ -108,6 +113,11 @@
"ReportingSubscriptionError",
"ReportingSubscriptionHost",
"ReportingSubscriptionPrecedenceHost",
"ReportingSubscriptionStateConflictError",
"ReportingSubscriptionStateStore",
"StoredReportingSubscriptionState",
"decode_principal_state",
"encode_principal_state",
"apply_reporting_subscriptions",
"refresh_destination_states",
"render_path_template",
Expand Down
Loading
Loading