File: architecture.rst

package info (click to toggle)
python-gearman 2.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 464 kB
  • ctags: 471
  • sloc: python: 2,285; makefile: 135
file content (29 lines) | stat: -rw-r--r-- 1,230 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
===============
Design document
===============

Architectural design document for developers

GearmanConnectionManager - Bridges low-level I/O <-> command handlers
=====================================================================
* Only class that an API user should directly interact with
* Manages all I/O: polls connections, reconnects failed connections, etc...
* Forwards commands between Connections <-> CommandHandlers
* Manages multiple Connections and multple CommandHandlers
* Manages global state of an interaction with Gearman (global job lock)

GearmanConnection - Manages low-level I/O
=========================================
* A single connection between a client/worker and a server
* Thinly wrapped socket that can reconnect
* Converts binary strings <-> Gearman commands
* Manages in/out data buffers for socket-level operations
* Manages in/out command buffers for gearman-level operations

GearmanCommandHandler - Manages commands
========================================
* Represents the state machine of a single GearmanConnection
* 1-1 mapping to a GearmanConnection (via GearmanConnectionManager)
* Sends/receives commands ONLY - does no buffering
* Handles all command generation / interpretation