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
impl StreamingQueryManager
Sourcepub fn add_listener(
&self,
listener: Arc<dyn StreamingQueryListener>,
) -> Result<String>
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.
Sourcepub fn remove_listener(&self, id: &str) -> Result<()>
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.
Sourcepub fn close(&self) -> Result<()>
pub fn close(&self) -> Result<()>
Remove all client-side listeners and stop the dispatch thread. Mirrors
StreamingQueryManager.close.
Sourcepub fn active(&self) -> Result<Vec<StreamingQuery>>
pub fn active(&self) -> Result<Vec<StreamingQuery>>
Get all active streaming queries.
Sourcepub fn get(&self, id: &str) -> Result<Option<StreamingQuery>>
pub fn get(&self, id: &str) -> Result<Option<StreamingQuery>>
Get a specific streaming query by ID.
Sourcepub fn await_any_termination(
&self,
timeout_sec: Option<f64>,
) -> Result<Option<bool>>
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.
Sourcepub fn reset_terminated(&self) -> Result<()>
pub fn reset_terminated(&self) -> Result<()>
Reset terminated streaming queries.
Sourcepub fn register_python_listener(
&self,
payload: PythonUDFPayload,
) -> Result<String>
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.
Sourcepub fn unregister_python_listener(&self, listener_id: &str) -> Result<()>
pub fn unregister_python_listener(&self, listener_id: &str) -> Result<()>
Remove a server-side listener registered via
register_python_listener, by id.
Sourcepub fn listener_event_stream(&self) -> Result<ListenerEventStream>
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§
impl !RefUnwindSafe for StreamingQueryManager
impl !UnwindSafe for StreamingQueryManager
impl Freeze for StreamingQueryManager
impl Send for StreamingQueryManager
impl Sync for StreamingQueryManager
impl Unpin for StreamingQueryManager
impl UnsafeUnpin for StreamingQueryManager
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request