pub struct FlightLeader { /* private fields */ }Expand description
Handle for the leader thread that will execute the query and notify followers.
If the leader is dropped without calling complete() (e.g., the thread panics),
the Drop impl removes the key from the in-flight map so new requests don’t
wait on a dead condvar. Followers waiting on the condvar are woken and will
find None in the result, which surfaces as a query error.
Implementations§
Source§impl FlightLeader
impl FlightLeader
Sourcepub fn complete(
self,
sf: &Singleflight,
result: Arc<Result<Arc<OwnedResultSnapshot>, BsqlError>>,
)
pub fn complete( self, sf: &Singleflight, result: Arc<Result<Arc<OwnedResultSnapshot>, BsqlError>>, )
Send the result to all waiting followers and remove from in-flight map.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FlightLeader
impl RefUnwindSafe for FlightLeader
impl Send for FlightLeader
impl Sync for FlightLeader
impl Unpin for FlightLeader
impl UnsafeUnpin for FlightLeader
impl UnwindSafe for FlightLeader
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