Add finalize function to processor

This commit is contained in:
taizan-hokuto
2020-07-12 23:23:05 +09:00
parent a7379fd93f
commit 971e4bdf39
3 changed files with 10 additions and 1 deletions

View File

@@ -325,7 +325,8 @@ 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):
''' '''
Listenerを終了する。 Listenerを終了する。

View File

@@ -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):
''' '''

View File

@@ -21,3 +21,10 @@ class ChatProcessor:
} }
''' '''
pass pass
def finalize(self, *args, **kwargs):
'''
Interface for finalizing the process.
Called when chat fetching finished.
'''
pass