pub struct ExternalTransform { /* private fields */ }Expand description
External (child-stdio) transform stage.
surreal-sync spawns the configured worker and talks on the worker’s stdin/stdout pipes — not the surreal-sync CLI’s stdin.
Exchanges are multiplexed by batch_id: ExternalTransport::write_request
/ ExternalTransport::try_read_response support overlapping in-flight
batches (max_in_flight > 1). Each waiter reads only its own request’s
response (request-keyed); payloads are never rebound onto another
outstanding id. A mismatched echo fails the exchange (no sink / watermark advance).
§Relations
Relation batches use the same NDJSON framing with
WireItemKind::RelationChange / WireItemKind::Relation. There is no
silent pass-through of relation events past External stages.
Implementations§
Source§impl ExternalTransform
impl ExternalTransform
Sourcepub fn with_transport(transport: Arc<dyn ExternalTransport>) -> Self
pub fn with_transport(transport: Arc<dyn ExternalTransport>) -> Self
Build an external stage over an arbitrary multiplexed transport.
Sourcepub fn with_timeout(self, timeout: Option<Duration>) -> Self
pub fn with_timeout(self, timeout: Option<Duration>) -> Self
Set per-exchange timeout for this stage (None clears it).
Intended as a builder step at construction time (before the stage is shared across in-flight batches).
Sourcepub fn with_retry(self, retry: RetryPolicy) -> Self
pub fn with_retry(self, retry: RetryPolicy) -> Self
Set per-stage retry/backoff policy.
Intended as a builder step at construction time.
Sourcepub fn persistent_child(
command: Vec<String>,
framer: FramerKind,
) -> Result<Self>
pub fn persistent_child( command: Vec<String>, framer: FramerKind, ) -> Result<Self>
Spawn a persistent child worker (default mode): one process, many batches.
Sourcepub fn transient_child(command: Vec<String>, framer: FramerKind) -> Result<Self>
pub fn transient_child(command: Vec<String>, framer: FramerKind) -> Result<Self>
Transient child worker: spawn → one exchange → exit, per batch.
Sourcepub fn child_stdio(
mode: ChildStdioMode,
command: Vec<String>,
framer: FramerKind,
) -> Result<Self>
pub fn child_stdio( mode: ChildStdioMode, command: Vec<String>, framer: FramerKind, ) -> Result<Self>
Convenience from mode + argv + framer.
Sourcepub fn command_from_bin(bin: impl Into<PathBuf>, args: &[&str]) -> Vec<String>
pub fn command_from_bin(bin: impl Into<PathBuf>, args: &[&str]) -> Vec<String>
Path helper for tests locating a fixture binary.
Sourcepub async fn exchange_changes(
&self,
batch_id: u64,
changes: Vec<Change>,
) -> Result<Vec<Change>>
pub async fn exchange_changes( &self, batch_id: u64, changes: Vec<Change>, ) -> Result<Vec<Change>>
Exchange a change batch with the worker (serialize → I/O → deserialize).
Sourcepub async fn exchange_rows(
&self,
batch_id: u64,
rows: Vec<Row>,
) -> Result<Vec<Row>>
pub async fn exchange_rows( &self, batch_id: u64, rows: Vec<Row>, ) -> Result<Vec<Row>>
Exchange a row batch with the worker.
Sourcepub async fn exchange_relation_changes(
&self,
batch_id: u64,
changes: Vec<RelationChange>,
) -> Result<Vec<RelationChange>>
pub async fn exchange_relation_changes( &self, batch_id: u64, changes: Vec<RelationChange>, ) -> Result<Vec<RelationChange>>
Exchange a relation-change batch with the worker (NDJSON wire).
Trait Implementations§
Source§impl Clone for ExternalTransform
impl Clone for ExternalTransform
Source§fn clone(&self) -> ExternalTransform
fn clone(&self) -> ExternalTransform
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more