Cocaine

What is Cocaine? It’s an open-source cloud platform enabling you to build your own PaaS clouds using simple yet effective dynamic components.

This documentation is for cocaine-framework-python.

Features

  • Possibility to write cocaine workers
  • Wide support of asynchronous event-driven usage
  • Ready for usage with cloud services
  • Lot of examples included
  • Provided with cocaine-tools and embedded cocaine proxy
  • PyPy support

Quick example

Here’s some extremely useful Cocaine app written in Python:

#!/usr/bin/env python

from cocaine.services import Service
from cocaine.worker import Worker

storage = Service("storage")

def process(value):
    return len(value)

def handle(request, response):
    key = yield request.read()
    value = yield storage.read("collection", key)

    response.write(process(value))
    response.close()

Worker().run({
    'calculate_length': handle
})
Read the Docs v: v0.10
Versions
latest
v0.11
v0.10
Downloads
HTML
Epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.