Struct springql_core::api::SpringPipeline
source · [−]pub struct SpringPipeline(_);
Expand description
Pipeline.
Implementations
sourceimpl 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 RefUnwindSafe for SpringPipeline
impl Send for SpringPipeline
impl Sync for SpringPipeline
impl Unpin for SpringPipeline
impl UnwindSafe for SpringPipeline
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more