Skip to main content

kamma is a very simplified Task File Queue

Project description

kamma is a very simplified task file queue that persists tasks and its needed data. It also has a worker that process all pending tasks.

Version Versions Status Coverage License


Nowadays local disk access is an undervalued resource for many reasons, however stored data is always available even after power outage. By contrast, network resources or remote third parties are not always ready. Is for this reason I developed the kamma in order to isolate dependent tasks from the miseries of remote services. kamma would try process all pending tasks forever respecting the queue order.


  • Up to (sys.maxint - FileQue.max_head_index) tasks can be queued as maximum.
  • All task’s arguments should be serializable by json
  • Not recommended for high performance scenarios.


As simple as:

pip install kamma


import kamma

# python 2 and 3 compatibility issue
   input = raw_input
except NameError:

# kamma worker
app = kamma.Worker()

# registering fibonacci callback in kamma app
@app.task_callback(timeout=5, retry_wait=kamma.wait_fixed(1),
def fibonacci(n, level=0):
    result = 1
    if n < 0 or n > 100:
        raise kamma.AbortTask("n has to be 0 <= n <= 100")
    if n > 1:
        result = fibonacci(n - 1, level=level + 1) + fibonacci(n - 2, level=level + 1)
    if level == 0:
        print("*** RESULT: fibonacci of '{}' is '{}' ***".format(n, result))
    return result

if __name__ == "__main__":
    # start listening for incoming tasks
    print("Enter the value of the fibonacci you want to compute, 0 to exit")
    n = 1
    while True:
        n = int(input(""))
        if n == 0:
        # add new fibonacci task
        app.push_task(fibonacci, n=n)

The complete example here: examples/

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for kamma, version 0.0.10
Filename, size & hash File type Python version Upload date
kamma-0.0.10-py2.py3-none-any.whl (10.3 kB) View hashes Wheel py2.py3
kamma-0.0.10.tar.gz (7.7 kB) View hashes Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page