pub struct CrawlerState {
pub in_flight_requests: Atomic<usize>,
pub parsing_responses: Atomic<usize>,
pub processing_items: Atomic<usize>,
}Expand description
Represents the shared state of the crawler’s various actors.
This struct provides a centralized mechanism for monitoring the real-time activity of the web crawler. It utilizes atomic counters to keep track of:
- The number of HTTP requests currently in flight (being downloaded).
- The number of responses actively being parsed by spiders.
- The number of scraped items currently being processed by pipelines.
This state information is crucial for determining when the crawler is idle and can be gracefully shut down, or when to trigger checkpointing.
Fields§
§in_flight_requests: Atomic<usize>The number of requests currently being downloaded.
parsing_responses: Atomic<usize>The number of responses currently being parsed.
processing_items: Atomic<usize>The number of items currently being processed by pipelines.
Implementations§
Source§impl CrawlerState
impl CrawlerState
Trait Implementations§
Source§impl Debug for CrawlerState
impl Debug for CrawlerState
Source§impl Default for CrawlerState
impl Default for CrawlerState
Source§fn default() -> CrawlerState
fn default() -> CrawlerState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for CrawlerState
impl RefUnwindSafe for CrawlerState
impl Send for CrawlerState
impl Sync for CrawlerState
impl Unpin for CrawlerState
impl UnsafeUnpin for CrawlerState
impl UnwindSafe for CrawlerState
Blanket Implementations§
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
Mutably borrows from an owned value. Read more