[Bug or Feature Requests] aioredis connect raise 'Event callback failed'
Opened this issue · 0 comments
625781186 commented
env:
python 3.6.4 64bit
pyqt5 5.10.1
aioredis 1.1.0 ~1.3.0
quamash 0.6.1
error:
use asyncio loop is ok:
##testcode.py
from PyQt5.QtWidgets import QApplication, QProgressBar
from quamash import QEventLoop, QThreadExecutor
app = QApplication(sys.argv)
loop = QEventLoop(app)
asyncio.set_event_loop(loop) # NEW must set the event loop
progress = QProgressBar()
progress.setRange(0, 99)
progress.show()
async def master():
await first_50()
async def first_50():
red_sql = await aioredis.create_redis_pool(f"redis://localhost:6379/1")
with loop: ## context manager calls .close() when loop completes, and releases all resources
loop.run_until_complete(master())