0 purchases
reds 0.1.9
reds
Request/Response library on top of Redis.
Simple Client/Server example
Client:
from redis import StrictRedis
from reds import Reds
def main():
key = 'test:queue'
redis = StrictRedis()
reds = Reds(redis=redis, key=key)
for i in range(10):
task = reds.create_task(task_dict={
'id': i
})
print(task.send())
if __name__ == '__main__':
main()
Server:
import time
from random import random
from redis import StrictRedis
from reds import Reds
def main():
key = 'test:queue'
redis = StrictRedis()
reds = Reds(redis=redis, key=key)
for task in reds.listen():
print(task)
time.sleep(1)
task.respond(task_dict={
'success': random() > 0.5
})
if __name__ == '__main__':
main()
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.