Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    supervisor_cache 0.5

    Download button

    No screenshots available
    Downloads: 364  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Mike Naberezny | More programs
    BSD License / FREE
    February 21st, 2010, 10:11 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    supervisor_cache description

    RPC extension for supervisor

    supervisor_cache is an RPC extension for the supervisor module that provides the ability to cache limited amounts of data in the supervisor instance as key/value pairs.

    Installation

    Release packages are available on the Python Package Index (PyPI). You can download them from there or you can use easy_install to automatically install or upgrade:

    $ easy_install -U supervisor_cache

    Alternatively, you can download a package from GitHub in .tar.gz or .zip format. After extracting the package, use the following command to install:

    $ python setup.py install

    After installing the package, you must modify your supervisord.conf file to register the RPC interface and supervisorctl plugin:

    [rpcinterface:cache]
    supervisor.rpcinterface_factory = supervisor_cache.rpcinterface:make_cache_rpcinterface

    [ctlplugin:cache]
    supervisor.ctl_factory = supervisor_cache.controllerplugin:make_cache_controllerplugin


    After modifying the supervisord.conf file, both your supervisord instance and supervisorctl must be restarted for these changes to take effect.

    Usage

    The cache functions allow key/value pairs to be stored and fetched. The following Python interpreter session demonstrates the usage.

    First, a ServerProxy object must be configured. If supervisord is listening on an inet socket, ServerProxy configuration is simple:

    >>> import xmlrpclib
    >>> s = xmlrpclib.ServerProxy('http://localhost:9001')


    If supervisord is listening on a domain socket, ServerProxy can be configured with SupervisorTransport. The URL must still be supplied and be a valid HTTP URL to appease ServerProxy, but it is superfluous.

    >>> import xmlrpclib
    >>> from supervisor.xmlrpc import SupervisorTransport
    >>> s = xmlrpclib.ServerProxy('http://127.0.0.1/whatever',
    ... SupervisorTransport('', '', 'unix:///path/to/supervisor.sock'))


    Once ServerProxy has been configured appropriately, we can now exercise supervisor_cache:

    >>> s.cache.getKeys()
    []
    >>> s.cache.store('foo', 'bar')
    True
    >>> s.cache.fetch('foo')
    'bar'
    >>> s.cache.getKeys()
    ['foo']


    The key must be a string and cannot be zero-length. The value must also be a string but is permitted to be zero-length.

    Please consult the inline source documentation for the specifics of each command available.


    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    RPC extension | supervisor cache | Python library | RPC | supervisor | cache

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM