deadapi package

Submodules

deadapi.api module

The HTTP API to the Deadlock server. Defines API endpoints / HTTP resource mountpoints.

class deadapi.api.Root(db)[source]

Bases: object

exposed = True

deadapi.events module

Translates Postgres NOTIFY to HTTP Eventsource.

class deadapi.events.EventSource(db, channels_map)[source]

Bases: object

Translates Postgres NOTIFY to HTTP Eventsource.

GET()[source]
exposed = True
class deadapi.events.Events(db, channels_map)[source]

Bases: object

Fans out notifies into all queues gotten from self.get_queue.

Translates event names according to the given channels map.

DEBOUNCE_TIMEOUT = 2
forward_notify(notify)[source]
get_queue()[source]
listen()[source]

deadapi.server module

deadapi.utils module

class deadapi.utils.Resource(db)[source]

Bases: object

An exposed RESTful resource that likes JSON and needs a DB connection.

exposed = True
deadapi.utils.header(key, value)[source]
deadapi.utils.json_handler(*args, **kwargs)[source]

Streaming JSON encoder for CherryPy. It can handle a few extra types.

deadapi.utils.m(orig, *over)[source]

Return a new dict merged from the given ones. Last wins.

Module contents

The HTTP API for Deadlock management, rules configuration and status monitoring.