pyspark.sql.streaming.StreamingQueryManager.removeListener

StreamingQueryManager.removeListener(listener: pyspark.sql.streaming.listener.StreamingQueryListener) → None[source]

Deregister a StreamingQueryListener.

New in version 3.4.0.

Parameters
listenerStreamingQueryListener

A StreamingQueryListener to receive up-calls for life cycle events of StreamingQuery.

Examples

>>> from pyspark.sql.streaming import StreamingQueryListener
>>> class TestListener(StreamingQueryListener):
...     def onQueryStarted(self, event):
...         pass
...
...     def onQueryProgress(self, event):
...         pass
...
...     def onQueryIdle(self, event):
...         pass
...
...     def onQueryTerminated(self, event):
...         pass
...
>>> test_listener = TestListener()

Register streaming query listener

>>> spark.streams.addListener(test_listener)

Deregister streaming query listener

>>> spark.streams.removeListener(test_listener)