Add finalize function to processor
This commit is contained in:
@@ -325,6 +325,7 @@ class LiveChatAsync:
|
|||||||
self._pauser.put_nowait(None)
|
self._pauser.put_nowait(None)
|
||||||
self._is_alive = False
|
self._is_alive = False
|
||||||
self._buffer.put_nowait({})
|
self._buffer.put_nowait({})
|
||||||
|
self.processor.finalize()
|
||||||
|
|
||||||
def _task_finished(self):
|
def _task_finished(self):
|
||||||
'''
|
'''
|
||||||
|
|||||||
@@ -316,6 +316,7 @@ class LiveChat:
|
|||||||
self._is_alive = False
|
self._is_alive = False
|
||||||
self._buffer.put({})
|
self._buffer.put({})
|
||||||
self._event.set()
|
self._event.set()
|
||||||
|
self.processor.finalize()
|
||||||
|
|
||||||
def _task_finished(self):
|
def _task_finished(self):
|
||||||
'''
|
'''
|
||||||
|
|||||||
@@ -21,3 +21,10 @@ class ChatProcessor:
|
|||||||
}
|
}
|
||||||
'''
|
'''
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def finalize(self, *args, **kwargs):
|
||||||
|
'''
|
||||||
|
Interface for finalizing the process.
|
||||||
|
Called when chat fetching finished.
|
||||||
|
'''
|
||||||
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user