Ginkgo Service Framework

Release: v0.6.0 (Installation)
License: MIT

Ginkgo is a lightweight framework for writing network service daemons in Python. It currently focuses on gevent as its core networking and concurrency layer.

The core idea behind Ginkgo is the “service model”, where your primary building block or component of applications are composable services. A service is a mostly self-contained module of your application that can start/stop/reload, contain other services, manage async operations, and expose configuration.

class ExampleService(Service):
    setting = Setting("example.setting", default="Foobar")

    def __init__(self):
        logging.info("Service is initializing.")

        self.child_service = AnotherService()
        self.add_service(self.child_service)

    def do_start(self):
        logging.info("Service is starting.")

        self.spawn(self.something_async)

    def do_stop(self):
        logging.info("Service is stopping.")

    def do_reload(self):
        logging.info("Service is reloading.")

    # ...

Around this little bit of structure and convention, Ginkgo provides just a few baseline features to make building both complex and simple network daemons much easier:

  • Service class primitive for composing daemon apps from simple components
  • Dynamic configuration loaded from regular Python source files
  • Runner and service manager tool for easy, consistent usage and deployment
  • Integrated support for standard Python logging

API Reference

Developer Guide

Project Versions

Table Of Contents

Next topic

Introduction

This Page