Was this page helpful?
Caution
You're viewing documentation for a deprecated version of Scylla Rust Driver. Switch to the latest stable version.
The easiest speculative execution policy available. It starts another
execution of a query after constant delay of retry_interval
and does at most
max_retry_count
speculative query executions (not counting the first,
non-speculative one).
To use this policy in Session
:
use std::{sync::Arc, time::Duration};
use scylla::{
Session,
SessionBuilder,
speculative_execution::SimpleSpeculativeExecutionPolicy,
transport::execution_profile::ExecutionProfile,
};
let policy = SimpleSpeculativeExecutionPolicy {
max_retry_count: 3,
retry_interval: Duration::from_millis(100),
};
let handle = ExecutionProfile::builder()
.speculative_execution_policy(Some(Arc::new(policy)))
.build()
.into_handle();
let session: Session = SessionBuilder::new()
.known_node("127.0.0.1:9042")
.default_execution_profile_handle(handle)
.build()
.await?;
Was this page helpful?
On this page