#[non_exhaustive]pub struct FeedSection {
pub units_held: Option<NonZeroUsize>,
pub attempt_cap: Option<NonZeroU32>,
pub location: Option<String>,
pub settling_window: Option<Duration>,
/* private fields */
}Expand description
The pipeline’s feed: section, handed to the source through
Source::configure_feed.
One key names the backend, with the same single-key shape as source:;
its body holds the backend’s own keys and is decoded by the backend.
units_held applies whatever the backend; attempt_cap applies to the
in-process and Kafka feeds, and a backend that cannot honor it refuses
it; a source that re-enqueues units caps them at it. location names a job location for a source that reads one, and
settling_window is the settling window of a source that ends a job
with a location; the in-process feed refuses both.
feed:
memory: {}
units_held: 32Construct one in code with FeedSection::new and set the optional
fields. The struct is #[non_exhaustive] so new keys can be added
without breaking callers.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.units_held: Option<NonZeroUsize>Units the source holds and reads at once. None leaves the source’s
own default.
attempt_cap: Option<NonZeroU32>The delivery on which a failed unit moves to its feed’s dead-letter
destination, on the in-process and Kafka feeds. The Kafka feed also
moves a unit whose recorded deliveries have reached it, without
delivering it again. None leaves the backend’s default. A backend
that cannot honor the key refuses it. A source that re-enqueues units
caps their re-enqueues at it.
location: Option<String>A job location, an object-store prefix, for a source that reads
one; that source defines what the prefix holds. None when the
section names none.
The in-process feed refuses one.
settling_window: Option<Duration>The settling window of a job with a location, for a source that ends
one through an EndCheck: how long the feed
must read empty before the job ends. The source’s page says what else
it bounds. None leaves
DEFAULT_SETTLING_WINDOW. The
in-process feed refuses one.
Implementations§
Source§impl FeedSection
impl FeedSection
Sourcepub fn new(backend: ComponentConfig) -> FeedSection
pub fn new(backend: ComponentConfig) -> FeedSection
A section naming backend, with every other key unset. Errors from
the backend’s body carry paths such as feed.memory.<key>.
use spate_core::config::{ComponentConfig, FeedSection, YamlValue};
use std::num::NonZeroUsize;
let mut feed = FeedSection::new(ComponentConfig::new(
"memory",
YamlValue::Mapping(Default::default()),
));
feed.units_held = NonZeroUsize::new(32);
assert_eq!(feed.backend().type_tag(), "memory");Sourcepub fn backend(&self) -> &ComponentConfig
pub fn backend(&self) -> &ComponentConfig
Sourcepub fn settling_window_or_default(&self) -> Duration
pub fn settling_window_or_default(&self) -> Duration
The section’s settling_window, or
DEFAULT_SETTLING_WINDOW when
it sets none.