pub struct SessionDispatcher { /* private fields */ }Implementations§
Source§impl SessionDispatcher
impl SessionDispatcher
pub fn new( buffer: Arc<SessionBuffer>, http: Arc<HttpClient>, app_version: Option<String>, ) -> Self
Sourcepub fn flush_once(&self) -> RovenueResult<usize>
pub fn flush_once(&self) -> RovenueResult<usize>
Send every buffered event, oldest first, each under the identity it
was recorded under (a log out in between changes nothing). One POST
carries the leading run of up to 200 rows that share a rovenue_id;
runs are sent in order until the buffer is empty or a POST fails.
Rows are deleted ONLY after the server confirms receipt (2xx). On a 503 (Kafka down) or network error the run is retained and retried on the next tick — the API returns 503 precisely to signal “keep it”. This is at-least-once delivery; the server derives a deterministic eventId from the event’s stable fields so a replayed batch dedupes in ClickHouse. Growth is bounded by the buffer’s FIFO cap (newest 1000 on append). Returns the number of events sent.
pub fn start(self: Arc<Self>, scheduler: &PollingScheduler)
Auto Trait Implementations§
impl Freeze for SessionDispatcher
impl !RefUnwindSafe for SessionDispatcher
impl Send for SessionDispatcher
impl Sync for SessionDispatcher
impl Unpin for SessionDispatcher
impl !UnwindSafe for SessionDispatcher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more