- Runs as a TCP server.
- Requests can be made from any other application which can open TCP ports.
- Uses ZeroMQ 'ROUTER' socket. Clients should use ZeroMQ 'REQ', 'DEALER' or 'ROUTER'.
- Work is distributed between workers pool.
- Workers run on separate threads (goroutines).
- Each worker has a DB connection.
- Workers have work buffers.
- The server distributes requests between workers by selecting the worker which has the least items in the buffer.
Commands are sent as multi-part messages. The following shows the parts space separated:
- Question:
Q [ID]
- Question joins:
QJ [ID] [COUNT] [PAGE]
- Question latest comments:
QLC [ID] [COUNT] [PAGE]
- Answer:
A [ID]
- Question top answers:
QTA [ID] [COUNT] [PAGE]
- Question latest answers:
QLA [ID] [COUNT] [PAGE]
Reponses are sent as a 3-part message:
- Success? true / false string
- Empty? true / false string
- Payload - JSON encoded string