Documentation ¶ Index ¶ func New(cfg Config, log logger.Log) *worker type Config type Message type Worker Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func New ¶ func New(cfg Config, log logger.Log) *worker Types ¶ type Config ¶ type Config struct { Rc int // push retries Name string // worker's name Timeout time.Duration // process time limit } type Message ¶ type Message struct { Msg []string Rch chan []string Timeout time.Duration } type Worker ¶ type Worker interface { Run() Stop() SendChannel() chan<- *Message // channel should close after Stop by caller RecvChannel() <-chan *Message // channel will automatically close after stop } Source Files ¶ View all Source files types.go worker.go Directories ¶ Show internal Expand all Path Synopsis relay runtime Click to show internal directories. Click to hide internal directories.