You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import asyncio
import asyncio_redis
connection = asyncio_redis.Pool.create(host='localhost', port=6379, poolsize=10)
@asyncio.coroutine
def example():
# Set a key
yield from connection.set('my_key', 'my_value')
# When finished, close the connection pool.
connection.close()
[root@ubuntu:~]#python3.5 r.py
Traceback (most recent call last):
File "r.py", line 15, in
loop.run_until_complete(example())
File "/usr/lib/python3.5/asyncio/base_events.py", line 387, in run_until_complete
return future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
raise self._exception
File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
result = coro.send(None)
File "r.py", line 9, in example
yield from connection.set('my_key', 'my_value')
AttributeError: 'generator' object has no attribute 'set'
why cann't put asyncio_redis.Pool.create in other places ? thanks you .
The text was updated successfully, but these errors were encountered:
[root@ubuntu:~]#python3.5 r.py
Traceback (most recent call last):
File "r.py", line 15, in
loop.run_until_complete(example())
File "/usr/lib/python3.5/asyncio/base_events.py", line 387, in run_until_complete
return future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
raise self._exception
File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
result = coro.send(None)
File "r.py", line 9, in example
yield from connection.set('my_key', 'my_value')
AttributeError: 'generator' object has no attribute 'set'
why cann't put
asyncio_redis.Pool.create
in other places ? thanks you .The text was updated successfully, but these errors were encountered: