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.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    redique 0.1.1

    Download button

    No screenshots available
    Downloads: 115  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Ahmed Soliman | More programs
    MIT/X Consortium Lic... / FREE
    January 13th, 2012, 21:12 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    redique description

    A super easy Queued RPC on top of Redis

    redique is a super easy Queued RPC on top of Redis, with JSON marshalling protocol and exception marshalling.

    You normally want to use redique when you need to publish tasks to a set of workers to process asynchronously and retrieve the result using a task_id, or when you want to distribute workload over multiple workers easily without going through the hassle of understanding how message buses work.

    Getting Started

    You need to install the package first using pip > pip install redique

    Then you need to create a backend class that contains the actual logic you want implement over the transport

    class Calculator(object):
     def add(self, x, y):
     return x + y
     def raiseError(self):
     raise Exception("An Error Happened!")


    Then you need to create a queue consumer on your worker side:

    import redique
    calculator = Calculator()
    queue = redique.RediQue("calculator")
    queue.consume_loop(calculator)


    The last statement will block forever consuming tasks as they arrive.

    On the publisher machine you need to execute tasks remotely

    import redique
    queue = redique.RediQue("calculator")
    task_id = queue.push_task("add", 1, 2)
    print queue.get_task_state(task_id)
    print queue.wait_task_result(task_id)


    Another way to do that is to call execute_task that blocks till the result is returned

    import redique
    queue = redique.RediQue("calculator")
    print queue.execute_task("add", 1, 2)



    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    Queued RPC | JSON marshalling | Queued | RPC | Redis

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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