diff --git a/pytchat/core_async/livechat.py b/pytchat/core_async/livechat.py index 715064e..2cc3ff8 100644 --- a/pytchat/core_async/livechat.py +++ b/pytchat/core_async/livechat.py @@ -325,7 +325,8 @@ class LiveChatAsync: self._pauser.put_nowait(None) self._is_alive = False self._buffer.put_nowait({}) - + self.processor.finalize() + def _task_finished(self): ''' Listenerを終了する。 diff --git a/pytchat/core_multithread/livechat.py b/pytchat/core_multithread/livechat.py index e06bc8a..7f99c55 100644 --- a/pytchat/core_multithread/livechat.py +++ b/pytchat/core_multithread/livechat.py @@ -316,6 +316,7 @@ class LiveChat: self._is_alive = False self._buffer.put({}) self._event.set() + self.processor.finalize() def _task_finished(self): ''' diff --git a/pytchat/processors/chat_processor.py b/pytchat/processors/chat_processor.py index 98d2227..3af82e7 100644 --- a/pytchat/processors/chat_processor.py +++ b/pytchat/processors/chat_processor.py @@ -21,3 +21,10 @@ class ChatProcessor: } ''' pass + + def finalize(self, *args, **kwargs): + ''' + Interface for finalizing the process. + Called when chat fetching finished. + ''' + pass