reds 0.1.9

Creator: bradpython12

Last updated:

0 purchases

reds 0.1.9 Image
reds 0.1.9 Images

Languages

Categories

Add to Cart

Description:

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()

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.