pub struct EngineBuilder { /* private fields */ }Expand description
Builder for constructing an Engine with a fluent API.
Use Engine::builder() to create an instance. Without calling
output() or shared_output(),
the engine runs in benchmark mode (no output channel, no cloning overhead).
§Examples
use varpulis_runtime::{Engine, Metrics};
use tokio::sync::mpsc;
// Simple construction with output channel
let (tx, _rx) = mpsc::channel(100);
let mut engine = Engine::builder()
.output(tx)
.build();
// Full construction with metrics, DLQ, and context name
let (tx2, _rx2) = mpsc::channel(100);
let mut engine = Engine::builder()
.output(tx2)
.metrics(Metrics::new())
.context_name("worker-0")
.dlq_path("/var/log/varpulis-dlq.jsonl")
.build();
// Benchmark mode (no output, no cloning overhead)
let mut engine = Engine::builder().build();Implementations§
Source§impl EngineBuilder
impl EngineBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new builder with default configuration (benchmark mode, no output).
Sourcepub fn output(self, tx: Sender<Event>) -> Self
pub fn output(self, tx: Sender<Event>) -> Self
Set the output channel for emitted events (legacy owned channel).
Set a zero-copy shared output channel (recommended for performance).
Sourcepub fn context_name(self, name: impl Into<String>) -> Self
pub fn context_name(self, name: impl Into<String>) -> Self
Set the context name for this engine instance (used in multi-context deployments).
Sourcepub fn dlq_path(self, path: impl Into<PathBuf>) -> Self
pub fn dlq_path(self, path: impl Into<PathBuf>) -> Self
Set a custom dead-letter queue file path (default: varpulis-dlq.jsonl).
Sourcepub fn dlq_config(self, config: DlqConfig) -> Self
pub fn dlq_config(self, config: DlqConfig) -> Self
Set custom dead-letter queue configuration.
Sourcepub fn scalar_udf(self, udf: Arc<dyn ScalarUDF>) -> Self
pub fn scalar_udf(self, udf: Arc<dyn ScalarUDF>) -> Self
Register a native scalar UDF.
Sourcepub fn aggregate_udf(self, udf: Arc<dyn AggregateUDF>) -> Self
pub fn aggregate_udf(self, udf: Arc<dyn AggregateUDF>) -> Self
Register a native aggregate UDF.
Sourcepub fn credentials(self, store: Arc<CredentialsStore>) -> Self
pub fn credentials(self, store: Arc<CredentialsStore>) -> Self
Set the connector credentials store for resolving profile: references in VPL.
Sourcepub fn build(self) -> Engine
pub fn build(self) -> Engine
Build the engine. Returns the configured Engine ready for load().
After building, call Engine::load() or Engine::load_with_source()
to load a VPL program. Post-load configuration like
Engine::enable_checkpointing() and Engine::enable_watermark_tracking()
should be called after loading.
Trait Implementations§
Source§impl Debug for EngineBuilder
impl Debug for EngineBuilder
Auto Trait Implementations§
impl Freeze for EngineBuilder
impl !RefUnwindSafe for EngineBuilder
impl Send for EngineBuilder
impl Sync for EngineBuilder
impl Unpin for EngineBuilder
impl UnsafeUnpin for EngineBuilder
impl !UnwindSafe for EngineBuilder
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
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