Merge tag 'full_of_que_exception' into develop

v0.0.6.2
This commit is contained in:
taizan-hokuto
2020-03-07 22:58:13 +09:00
3 changed files with 16 additions and 2 deletions

View File

@@ -2,7 +2,7 @@
pytchat is a python library for fetching youtube live chat without using yt api, Selenium, or BeautifulSoup.
"""
__copyright__ = 'Copyright (C) 2019 taizan-hokuto'
__version__ = '0.0.6.1'
__version__ = '0.0.6.2'
__license__ = 'MIT'
__author__ = 'taizan-hokuto'
__author_email__ = '55448286+taizan-hokuto@users.noreply.github.com'

View File

@@ -20,6 +20,13 @@ class Buffer(asyncio.Queue):
super().get_nowait()
await super().put(item)
def put_nowait(self,item):
if item is None:
return
if super().full():
super().get_nowait()
super().put_nowait(item)
async def get(self):
ret = []
ret.append(await super().get())

View File

@@ -22,6 +22,13 @@ class Buffer(queue.Queue):
else:
super().put(item)
def put_nowait(self,item):
if item is None:
return
if super().full():
super().get_nowait()
else:
super().put_nowait(item)
def get(self):
ret = []