Skip to main content

photon_backend/
lib.rs

1//! Transport log, storage adapters, and delivery for Photon.
2//!
3//! Pluggable [`StoragePort`] implementations, unified [`GenericPhotonBackend`],
4//! subscriptions, checkpoints, retention, and consumer groups.
5//!
6//! ## Goals
7//!
8//! - Append-only sequenced transport with swappable storage adapters (`mem`, `sqlite`, broker tiers)
9//! - Durable subscriptions with coalesced checkpoints and optional retention reclaim
10//! - Consumer-group shard routing for load-balanced handlers
11//!
12//! ## Non-goals
13//!
14//! - Canonical system-of-record datastore (transport log is encrypted and transient)
15//! - Ops/admin UI (hosts provide their own)
16//!
17//! Facade documentation map: `cargo doc -p uf-photon --features runtime,mem --open`.
18
19#![cfg(feature = "runtime")]
20
21pub mod backend;
22pub mod checkpoint;
23pub mod consumer_group;
24pub mod delivery;
25pub mod delivery_mode;
26pub mod descriptor;
27pub mod error;
28pub mod event;
29pub mod executor_services;
30pub mod group_subscribe;
31pub mod handler_ctx;
32pub mod handler_descriptor;
33pub mod handler_registry;
34pub mod instrumentation;
35pub mod models;
36pub mod publish_routing;
37pub mod registry;
38pub mod retention;
39pub mod shard_router;
40pub mod storage;
41
42pub use backend::{
43    BackendCapabilities, BackendContext, EmbeddedBackend, GenericPhotonBackend, PhotonBackend,
44};
45pub use consumer_group::{
46    ConsumerGroupCoordinator, ConsumerLease, FleetGroupCoordinator, GroupMember, LeaseStore,
47    MemoryLeaseStore, StaticGroupCoordinator,
48};
49pub use delivery_mode::{DeliveryMode, ShardConfig};
50pub use descriptor::TopicDescriptor;
51pub use error::{PhotonError, Result};
52pub use event::TransportCrypto;
53pub use executor_services::ExecutorServices;
54pub use group_subscribe::merge_shard_streams;
55pub use handler_ctx::HandlerCtx;
56pub use handler_descriptor::HandlerDescriptor;
57pub use handler_registry::HandlerRegistry;
58pub use publish_routing::{resolve_publish_target, PublishTarget};
59pub use shard_router::{
60    group_publish_storage_key, is_shard_storage_key, parse_shard_storage_key, routing_key,
61    shard_id, shard_storage_key, SHARD_KEY_PREFIX,
62};
63pub use models::{
64    Envelope, Event, GroupOpts, SubscribeOpts, Subscription, SubscriptionHandle, SubscriptionMode,
65    TopicMetadata,
66};
67pub use registry::TopicRegistry;
68pub use retention::{
69    ReclaimReport, RetentionDeps, RetentionHook, RetentionPolicy, RetentionReclaimer,
70    SubscriptionPartition, TopicPartition,
71};
72pub use storage::{InProcStoragePort, StorageCapabilities, StoragePort, topic_filter_matches};
73
74pub use quark::inventory;