Skip to content

etataurov/nameko-redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nameko-redis

PyPI version Build Status

Redis dependency for nameko services

Installation

pip install nameko-redis

Usage

from nameko.rpc import rpc
from nameko_redis import Redis


class MyService(object):
    name = "my_service"

    redis = Redis('development')

    @rpc
    def hello(self, name):
        self.redis.set("foo", name)
        return "Hello, {}!".format(name)

    @rpc
    def bye(self):
        name = self.redis.get("foo")
        return "Bye, {}!".format(name)

To specify redis connection string you will need a config

AMQP_URI: 'amqp://guest:guest@localhost'
REDIS_URIS:
 development: 'redis://localhost:6379/0'

You can also pass extra options to the class, like this:

class MyOtherService(object):
    name = "my_other_service"

    redis = Redis('development', decode_responses=False, encoding='utf-8')

    ...

About

Redis dependency for nameko services

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy