Skip to main content

Crate photon_backend

Crate photon_backend 

Source
Expand description

Transport log, storage adapters, and delivery for Photon.

Pluggable StoragePort implementations, unified GenericPhotonBackend, subscriptions, checkpoints, retention, and consumer groups.

§Goals

  • Append-only sequenced transport with swappable storage adapters (mem, sqlite, broker tiers)
  • Durable subscriptions with coalesced checkpoints and optional retention reclaim
  • Consumer-group shard routing for load-balanced handlers

§Non-goals

  • Canonical system-of-record datastore (transport log is encrypted and transient)
  • Ops/admin UI (hosts provide their own)

Facade documentation map: cargo doc -p uf-photon --features runtime,mem --open.

Re-exports§

pub use backend::BackendCapabilities;
pub use backend::BackendContext;
pub use backend::EmbeddedBackend;
pub use backend::GenericPhotonBackend;
pub use backend::PhotonBackend;
pub use consumer_group::ConsumerGroupCoordinator;
pub use consumer_group::ConsumerLease;
pub use consumer_group::FleetGroupCoordinator;
pub use consumer_group::GroupMember;
pub use consumer_group::LeaseStore;
pub use consumer_group::MemoryLeaseStore;
pub use consumer_group::StaticGroupCoordinator;
pub use delivery_mode::DeliveryMode;
pub use delivery_mode::ShardConfig;
pub use descriptor::TopicDescriptor;
pub use error::PhotonError;
pub use error::Result;
pub use event::TransportCrypto;
pub use executor_services::ExecutorServices;
pub use group_subscribe::merge_shard_streams;
pub use handler_ctx::HandlerCtx;
pub use handler_descriptor::HandlerDescriptor;
pub use handler_registry::HandlerRegistry;
pub use publish_routing::resolve_publish_target;
pub use publish_routing::PublishTarget;
pub use shard_router::group_publish_storage_key;
pub use shard_router::is_shard_storage_key;
pub use shard_router::parse_shard_storage_key;
pub use shard_router::routing_key;
pub use shard_router::shard_id;
pub use shard_router::shard_storage_key;
pub use shard_router::SHARD_KEY_PREFIX;
pub use models::Envelope;
pub use models::Event;
pub use models::GroupOpts;
pub use models::SubscribeOpts;
pub use models::Subscription;
pub use models::SubscriptionHandle;
pub use models::SubscriptionMode;
pub use models::TopicMetadata;
pub use registry::TopicRegistry;
pub use retention::ReclaimReport;
pub use retention::RetentionDeps;
pub use retention::RetentionHook;
pub use retention::RetentionPolicy;
pub use retention::RetentionReclaimer;
pub use retention::SubscriptionPartition;
pub use retention::TopicPartition;
pub use storage::InProcStoragePort;
pub use storage::StorageCapabilities;
pub use storage::StoragePort;
pub use storage::topic_filter_matches;
pub use quark::inventory;

Modules§

backend
Backend implementations and assembly context for Photon.
checkpoint
Checkpoint coalescing for durable subscriptions.
consumer_group
Consumer group coordination: shard assignment and leases.
delivery
Handler delivery: backpressure and dead-letter queue.
delivery_mode
Topic delivery mode and virtual shard configuration.
descriptor
Topic descriptor for auto-registration.
error
Error types for Photon.
event
Event envelope encryption.
executor_services
Shared runtime services for handler delivery (constructed at Photon build time).
group_subscribe
Multiplex assigned virtual shard streams for consumer-group subscribers.
handler_ctx
Delivery metadata injectable into #[photon::subscribe] handlers (v2).
handler_descriptor
Handler descriptor for #[photon::subscribe] inventory registration.
handler_registry
Registry of #[photon::subscribe] handlers discovered via inventory.
instrumentation
Backend instrumentation (L0 publish telemetry + ops log helpers).
models
In-memory models for Photon entities.
publish_routing
Resolve storage keys for publishes based on topic delivery mode.
registry
Topic registry for discovering and looking up registered topics.
retention
Integrated transport retention / reclaim workflow.
shard_router
Virtual shard routing for consumer-group topics.
storage
Storage adapter port — one implementation per --storage tier (mem, sqlite, nats, fluvio, kafka).