Documentation ¶
Overview ¶
*
- Package queue implements a simple 'dynamic' queue, letting
- external services write to you so you can process them async
- and without any pressure to handle edge-cases like failure. *
- - /queue/<name>/<MD5(secret+name)>(.ok)
- <name> is channel to put HTTP-req in
- (.ok) is optional and when set returns OK as body (if remote party needs this)
- <secret> is key in overrides.toml
- - func health() returns health-status for queues
- <name> = {pending: X, first: <when it started processing>, last: <last time job was processed> lastOK: <last time job was sucessfully processed>, ok=N err=N} *
- This package uses boltdb to save the entries in buckets.
- /var/hfast.db > queue-bucket > name-bucket
*
- TCP localhost:11300 for workers to connect to
- Every minute PING/PONG
- It's a server push protocol, the server will inform event-driven
- the request.
- > HELLO hfast.v1
- < CHAN chan1 chan2 ...
- > READY
- > PING
- < PONG
- > JOB <id> <byte_len>
- > ............
- > ............
- < DONE <id>
Index ¶
Constants ¶
View Source
const WORKER_LISTEN = "localhost:11300"
Default listener
View Source
const WORKER_MAX = 100
Limit amount of connected workers
Variables ¶
View Source
var Listen net.Listener
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.