Struct garage_rpc::rpc_helper::RequestStrategy
source · pub struct RequestStrategy {
pub rs_quorum: Option<usize>,
pub rs_interrupt_after_quorum: bool,
pub rs_priority: RequestPriority,
/* private fields */
}
Expand description
Strategy to apply when making RPC
Fields§
§rs_quorum: Option<usize>
Min number of response to consider the request successful
rs_interrupt_after_quorum: bool
Should requests be dropped after enough response are received
rs_priority: RequestPriority
Request priority
Implementations§
source§impl RequestStrategy
impl RequestStrategy
sourcepub fn with_priority(prio: RequestPriority) -> Self
pub fn with_priority(prio: RequestPriority) -> Self
Create a RequestStrategy with default timeout and not interrupting when quorum reached
sourcepub fn with_quorum(self, quorum: usize) -> Self
pub fn with_quorum(self, quorum: usize) -> Self
Set quorum to be reached for request
sourcepub fn interrupt_after_quorum(self, interrupt: bool) -> Self
pub fn interrupt_after_quorum(self, interrupt: bool) -> Self
Set if requests can be dropped after quorum has been reached In general true for read requests, and false for write
sourcepub fn without_timeout(self) -> Self
pub fn without_timeout(self) -> Self
Deactivate timeout for this request
sourcepub fn with_custom_timeout(self, timeout: Duration) -> Self
pub fn with_custom_timeout(self, timeout: Duration) -> Self
Set custom timeout for this request
Trait Implementations§
source§impl Clone for RequestStrategy
impl Clone for RequestStrategy
source§fn clone(&self) -> RequestStrategy
fn clone(&self) -> RequestStrategy
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more