pub struct SpringPipeline(/* private fields */);
Expand description
Pipeline.
Implementations§
Source§impl SpringPipeline
impl SpringPipeline
Sourcepub fn new(config: &SpringConfig) -> Result<Self>
pub fn new(config: &SpringConfig) -> Result<Self>
Creates and open an in-process stream pipeline.
Sourcepub fn command<S: AsRef<str>>(&self, sql: S) -> Result<()>
pub fn command<S: AsRef<str>>(&self, sql: S) -> Result<()>
Execute commands (DDL).
§Failure
- SpringError::Sql when:
- Invalid SQL syntax.
- Refers to undefined objects (streams, pumps, etc)
- Other semantic errors.
- SpringError::InvalidOption when:
OPTIONS
inCREATE
statement includes invalid key or value.
Sourcepub fn pop(&self, queue: &str) -> Result<SpringSinkRow>
pub fn pop(&self, queue: &str) -> Result<SpringSinkRow>
Pop a row from an in memory queue. This is a blocking function.
Do not call this function from threads.
If you need to pop from multiple in-memory queues using threads, use pop_non_blocking()
.
See: https://github.com/SpringQL/SpringQL/issues/125
§Failure
- SpringError::Unavailable when:
- queue named
queue
does not exist.
- queue named
Sourcepub fn pop_non_blocking(&self, queue: &str) -> Result<Option<SpringSinkRow>>
pub fn pop_non_blocking(&self, queue: &str) -> Result<Option<SpringSinkRow>>
Pop a row from an in memory queue. This is a non-blocking function.
§Returns
Ok(Some)
when at least a row is in the queue.None
when no row is in the queue.
§Failure
- SpringError::Unavailable when:
- queue named
queue
does not exist.
- queue named
Sourcepub fn push(&self, queue: &str, row: SpringSourceRow) -> Result<()>
pub fn push(&self, queue: &str, row: SpringSourceRow) -> Result<()>
Push a row into an in memory queue. This is a non-blocking function.
§Failure
- SpringError::Unavailable when:
- queue named
queue
does not exist.
- queue named
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SpringPipeline
impl RefUnwindSafe for SpringPipeline
impl Send for SpringPipeline
impl Sync for SpringPipeline
impl Unpin for SpringPipeline
impl UnwindSafe for SpringPipeline
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