pub struct SourceSubscriptionSettings {
pub source_id: String,
pub enable_bootstrap: bool,
pub query_id: String,
pub nodes: HashSet<String>,
pub relations: HashSet<String>,
pub resume_from: Option<Bytes>,
pub request_position_handle: bool,
pub last_sequence: Option<u64>,
}Expand description
Settings passed to a source when subscribing
SourceSubscriptionSettings contains all the information a source needs to
intelligently handle bootstrap and subscription for a query, including the
specific node and relation labels the query is interested in.
§Fields
- source_id: ID of the source
- enable_bootstrap: Whether to request initial data
- query_id: ID of the subscribing query
- nodes: Set of node labels the query is interested in from this source
- relations: Set of relation labels the query is interested in from this source
§Example
use drasi_lib::config::SourceSubscriptionSettings;
use std::collections::HashSet;
let settings = SourceSubscriptionSettings {
source_id: "orders_db".to_string(),
enable_bootstrap: true,
query_id: "my-query".to_string(),
nodes: ["Order", "Customer"].iter().map(|s| s.to_string()).collect(),
relations: ["PLACED_BY"].iter().map(|s| s.to_string()).collect(),
resume_from: None,
request_position_handle: false,
last_sequence: None,
};Fields§
§source_id: String§enable_bootstrap: bool§query_id: String§nodes: HashSet<String>§relations: HashSet<String>§resume_from: Option<Bytes>If set, the subscribing query requests events replayed from this source position.
Contains the opaque position bytes that the source interprets to seek its change stream.
Only meaningful when the source returns supports_replay() == true.
request_position_handle: boolIf true, the query requests a shared Arc<AtomicU64> position handle in the
SubscriptionResponse for reporting its durably-processed position back to the source.
last_sequence: Option<u64>The last sequence number processed by this query before shutdown. Sources use this to ensure their sequence counter continues from where it left off, maintaining monotonicity across restarts.
Trait Implementations§
Source§impl Clone for SourceSubscriptionSettings
impl Clone for SourceSubscriptionSettings
Source§fn clone(&self) -> SourceSubscriptionSettings
fn clone(&self) -> SourceSubscriptionSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more