pub trait Fetch:
'static
+ Send
+ Sync
+ Debug {
// Required methods
fn request_ops(
&self,
op_ids: Vec<OpId>,
source: Url,
) -> BoxFut<'_, K2Result<()>>;
fn notify_on_drained(&self, notify: Sender<()>);
fn get_state_summary(&self) -> BoxFut<'_, K2Result<FetchStateSummary>>;
}Expand description
Trait for implementing a fetch module to fetch ops from other agents.
Required Methods§
Sourcefn request_ops(
&self,
op_ids: Vec<OpId>,
source: Url,
) -> BoxFut<'_, K2Result<()>>
fn request_ops( &self, op_ids: Vec<OpId>, source: Url, ) -> BoxFut<'_, K2Result<()>>
Add op ids to be fetched from a peer.
Sourcefn notify_on_drained(&self, notify: Sender<()>)
fn notify_on_drained(&self, notify: Sender<()>)
Request a notification when the fetch module has drained all pending requests.
If the queue is empty then the notification is sent immediately.
Note that this is exposed on the public API but is intended to be used by Kitsune2 itself, as a hint that the fetch module is ready to be given more work.
Sourcefn get_state_summary(&self) -> BoxFut<'_, K2Result<FetchStateSummary>>
fn get_state_summary(&self) -> BoxFut<'_, K2Result<FetchStateSummary>>
Get a state summary from the fetch module.