Skip to main content

StreamingQueryManager

Struct StreamingQueryManager 

Source
pub struct StreamingQueryManager { /* private fields */ }
Expand description

Manager for active streaming queries.

Mirrors pyspark.sql.connect.streaming.StreamingQueryManager, including a native client-side listener bus (so Rust clients get the listener feature too).

Implementations§

Source§

impl StreamingQueryManager

Source

pub fn add_listener( &self, listener: Arc<dyn StreamingQueryListener>, ) -> Result<String>

Register a client-side listener. Returns an id that can be passed to StreamingQueryManager::remove_listener. Starts the background dispatch thread when it is the first listener. Mirrors StreamingQueryManager.addListener.

Source

pub fn remove_listener(&self, id: &str) -> Result<()>

Remove a client-side listener by id. Stops the background dispatch thread when the last listener is removed. Mirrors StreamingQueryManager.removeListener.

Source

pub fn close(&self) -> Result<()>

Remove all client-side listeners and stop the dispatch thread. Mirrors StreamingQueryManager.close.

Source

pub fn active(&self) -> Result<Vec<StreamingQuery>>

Get all active streaming queries.

Source

pub fn get(&self, id: &str) -> Result<Option<StreamingQuery>>

Get a specific streaming query by ID.

Source

pub fn await_any_termination( &self, timeout_sec: Option<f64>, ) -> Result<Option<bool>>

Wait for any streaming query to terminate with optional timeout in seconds.

Source

pub fn reset_terminated(&self) -> Result<()>

Reset terminated streaming queries.

Source

pub fn register_python_listener( &self, payload: PythonUDFPayload, ) -> Result<String>

Register a server-side listener from a cloudpickled PythonUDF payload (the server runs it in a Python worker). This is distinct from the client-side listener bus (add_listener); it sends the AddListener manager command and returns the server listener id.

Source

pub fn unregister_python_listener(&self, listener_id: &str) -> Result<()>

Remove a server-side listener registered via register_python_listener, by id.

Source

pub fn listener_event_stream(&self) -> Result<ListenerEventStream>

Stream listener events from the server incrementally (live). Returns a ListenerEventStream that yields events as they arrive.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more