pub struct AeronArchiveReplayMerge { /* private fields */ }Implementations§
Source§impl AeronArchiveReplayMerge
impl AeronArchiveReplayMerge
Sourcepub fn new(
subscription: &AeronSubscription,
aeron_archive: &AeronArchive,
replay_channel: &CStr,
replay_destination: &CStr,
live_destination: &CStr,
recording_id: i64,
start_position: i64,
epoch_clock: c_longlong,
merge_progress_timeout_ms: i64,
) -> Result<Self, AeronCError>
pub fn new( subscription: &AeronSubscription, aeron_archive: &AeronArchive, replay_channel: &CStr, replay_destination: &CStr, live_destination: &CStr, recording_id: i64, start_position: i64, epoch_clock: c_longlong, merge_progress_timeout_ms: i64, ) -> Result<Self, AeronCError>
Create an AeronArchiveReplayMerge to manage the merging of a replayed stream into a live stream.
§Parameters
replay_mergetheAeronArchiveReplayMergeto create and initializesubscriptionthe subscription to use for the replay and live stream. Must be a multi-destination subscriptionaeron_archivethe archive clientreplay_channelthe channel to use for the replayreplay_destinationthe replay channel to use for the destination added by the subscriptionlive_destinationthe live stream channel to use for the destination added by the subscriptionrecording_idthe recording id of the archive to replaystart_positionthe start position of the replayepoch_clockthe clock to use for progress checksmerge_progress_timeout_msthe timeout to use for progress checks
§Return
0 for success, -1 for failure
Sourcepub fn do_work(&self) -> Result<c_int, AeronCError>
pub fn do_work(&self) -> Result<c_int, AeronCError>
Process the operation of the merge. Do not call the processing of fragments on the subscription.
§Parameters
work_count_pan indicator of work done
Sourcepub fn poll<AeronFragmentHandlerHandlerImpl: AeronFragmentHandlerCallback>(
&self,
handler: Option<&Handler<AeronFragmentHandlerHandlerImpl>>,
fragment_limit: c_int,
) -> Result<i32, AeronCError>
pub fn poll<AeronFragmentHandlerHandlerImpl: AeronFragmentHandlerCallback>( &self, handler: Option<&Handler<AeronFragmentHandlerHandlerImpl>>, fragment_limit: c_int, ) -> Result<i32, AeronCError>
Poll the image used for the merging replay and live stream. The aeron_archive_replay_merge_do_work will be called before the poll so that processing of the merge can be done.
§Parameters
handlerthe handler to call for incoming fragmentsclientdthe clientd to provide to the handlerfragment_limitthe max number of fragments to process before returning
§Return
= 0 indicates the number of fragments processed, -1 for failure
Sourcepub fn poll_fn<AeronFragmentHandlerHandlerImpl: FnMut(&[u8], &AeronHeader)>(
&self,
handler: AeronFragmentHandlerHandlerImpl,
fragment_limit: c_int,
) -> Result<i32, AeronCError>
pub fn poll_fn<AeronFragmentHandlerHandlerImpl: FnMut(&[u8], &AeronHeader)>( &self, handler: AeronFragmentHandlerHandlerImpl, fragment_limit: c_int, ) -> Result<i32, AeronCError>
Poll the image used for the merging replay and live stream. The aeron_archive_replay_merge_do_work will be called before the poll so that processing of the merge can be done.
§Parameters
handlerthe handler to call for incoming fragmentsclientdthe clientd to provide to the handlerfragment_limitthe max number of fragments to process before returning
§Return
= 0 indicates the number of fragments processed, -1 for failure
Stack-borrowed closure (_fn variant): the FnMut closure lives on the
caller’s stack and is borrowed for this call only. The callback fires
synchronously inside the call, so nothing is heap-allocated, nothing is stored,
and the closure may borrow local state. Prefer this over the retained
Handler-based form on the hot path; only generated for callbacks the C
client does not retain (i.e. not stored for later firing).
§Panics
A panic in the closure is passed to the caller. Fragments since the poll
started (or the last COMMIT) are delivered again on the next poll
Sourcepub fn image(&self) -> Ref<'_, AeronImage>
pub fn image(&self) -> Ref<'_, AeronImage>
Sourcepub fn has_failed(&self) -> bool
pub fn has_failed(&self) -> bool
Sourcepub fn is_live_added(&self) -> bool
pub fn is_live_added(&self) -> bool
Is the live destination added to the subscription?
§Return
true if the live destination is added to the subscription
pub fn get_inner(&self) -> *mut aeron_archive_replay_merge_t
Sourcepub unsafe fn get_inner_mut(&self) -> &mut aeron_archive_replay_merge_t
pub unsafe fn get_inner_mut(&self) -> &mut aeron_archive_replay_merge_t
Mutable access to the underlying C struct, minted from &self: nothing
prevents two live &mut at once, so the caller must ensure exclusive
access for the lifetime of the returned reference.
§Safety
No other reference (& or &mut) to the underlying struct may be
alive while the returned &mut is in use.
pub fn get_inner_ref(&self) -> &aeron_archive_replay_merge_t
impl AeronArchiveReplayMerge
§Exclusive use of the archive client
The merge reads its replay and recording-position responses from the archive client’s
shared control response stream. Until it has merged or failed, poll only the merge and use
that archive client for nothing else: do_work, poll_for_error, signal polls, blocking
calls such as get_max_recorded_position or start_replay all read the same stream and
skip responses that are not theirs, stalling the merge until its progress timeout. Archive errors reach the caller as Err from the merge’s
own poll, and Self::has_failed reports a failed merge.
Trait Implementations§
Source§impl Clone for AeronArchiveReplayMerge
impl Clone for AeronArchiveReplayMerge
Source§fn clone(&self) -> AeronArchiveReplayMerge
fn clone(&self) -> AeronArchiveReplayMerge
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more