pub struct BulkExecutor { /* private fields */ }Expand description
Executes bulk operations concurrently with rate limiting.
Implementations§
Source§impl BulkExecutor
impl BulkExecutor
pub fn new() -> Self
Sourcepub fn from_config(config: &SeerConfig) -> Self
pub fn from_config(config: &SeerConfig) -> Self
Builds an executor honoring ~/.seer/config.toml settings.
Reads bulk.concurrency (clamped to 1–50) and bulk.rate_limit_ms
for dispatch pacing, plus every per-protocol timeout
(timeouts.whois_secs / rdap_secs / dns_secs / http_secs) for
the internal sub-clients. The propagation checker deliberately keeps
its own tuned timeouts (a fan-out to every server in its list has
different latency characteristics than a single query).
pub fn with_concurrency(self, concurrency: usize) -> Self
pub fn with_rate_limit(self, delay: Duration) -> Self
pub async fn execute( &self, operations: Vec<BulkOperation>, progress: Option<ProgressCallback>, ) -> Vec<BulkResult>
Sourcepub async fn execute_streaming(
&self,
operations: Vec<BulkOperation>,
on_result: ResultCallback,
) -> Vec<BulkResult>
pub async fn execute_streaming( &self, operations: Vec<BulkOperation>, on_result: ResultCallback, ) -> Vec<BulkResult>
Like execute, but also invokes on_result with each
BulkResult as soon as it completes (completion order). Enables live
streaming of rows to a UI while the batch is still running.
Sourcepub async fn execute_each(
&self,
domains: Vec<String>,
op: impl FnMut(String) -> BulkOperation,
) -> Vec<BulkResult>
pub async fn execute_each( &self, domains: Vec<String>, op: impl FnMut(String) -> BulkOperation, ) -> Vec<BulkResult>
Runs one operation per domain, built by op — shorthand for mapping a
domain list into BulkOperations and calling
execute without a progress callback:
use seer_core::bulk::BulkOperation;
use seer_core::dns::RecordType;
let domains = vec!["example.com".to_string()];
let results = executor
.execute_each(domains, |domain| BulkOperation::Dns {
domain,
record_type: RecordType::MX,
})
.await;Trait Implementations§
Source§impl Clone for BulkExecutor
impl Clone for BulkExecutor
Source§impl Debug for BulkExecutor
impl Debug for BulkExecutor
Auto Trait Implementations§
impl !RefUnwindSafe for BulkExecutor
impl !UnwindSafe for BulkExecutor
impl Freeze for BulkExecutor
impl Send for BulkExecutor
impl Sync for BulkExecutor
impl Unpin for BulkExecutor
impl UnsafeUnpin for BulkExecutor
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more