Versions in this module Expand all Collapse all v0 v0.3.0 May 26, 2022 Changes in this version type Server + func (server *Server) ExpandTasks() v0.2.0 May 18, 2022 Changes in this version + const ProcessExpansion + const ProcessHandleControlMessage + const ProcessHandleRequestMessage + const TaskGroupNone + type BasicError string + const ErrInternalHandlerError + const ErrInvalidBody + const ErrInvalidHeader + const ErrInvalidTask + const ErrMessageNotAcked + const ErrMessageNotNacked + const ErrTaskInterrupted + const ErrTaskNotAdded + const ErrTaskNotKilled + func (e BasicError) Error() string + type DetailedError struct + BasicErr BasicError + Cause string + func NewDetailedError(err BasicError, cause string) *DetailedError + func (w *DetailedError) Error() string + type ErrorMonitor interface + RecordError func(err error) + type Handler func(header Headers, body []byte) (Task, error) + type Headers map[string]interface + type LatencyMonitor interface + RecordProcessDuration func(process string, duration time.Duration) + RecordTaskDuration func(group string, status SlotStatus, duration time.Duration) + type Message interface + Ack func() error + Body func() []byte + Headers func() Headers + Reject func(requeue bool) error + type Monitors struct + Error ErrorMonitor + Latency LatencyMonitor + Resource ResourceMonitor + type NopErrorMonitor struct + func (NopErrorMonitor) RecordError(_ error) + type NopLatencyMonitor struct + func (NopLatencyMonitor) RecordProcessDuration(_ string, _ time.Duration) + func (NopLatencyMonitor) RecordTaskDuration(_ string, _ SlotStatus, _ time.Duration) + type NopResourceMonitor struct + func (NopResourceMonitor) RecordTaskStarting(_ string, _ SlotStatus) + func (NopResourceMonitor) RecordTaskStopping(_ string, _ SlotStatus) + type ResourceMonitor interface + RecordTaskStarting func(group string, status SlotStatus) + RecordTaskStopping func(group string, status SlotStatus) + type Server struct + func NewServer(config ServerConfig) *Server + func (server *Server) HandleControlMsg(msg Message) + func (server *Server) HandleRequestMsg(msg Message) + func (server *Server) Shutdown(ctx context.Context) + type ServerConfig struct + ExpansionPeriod time.Duration + ExpansionSlotBuffer int + Handler Handler + HeaderKeyTaskID string + KillTimeout time.Duration + Monitors Monitors + Slots int + type SlotStatus string + const SlotStatusEmpty + const SlotStatusProtected + const SlotStatusUnprotectedExternal + const SlotStatusUnprotectedInternal + type Task interface + Details func() TaskDetails + Do func(ctx context.Context) error + Expand func(n int) []Task + Handle func(ctx context.Context, headers Headers, body []byte) error + type TaskDetails struct + Deadline time.Time + Group string + ID string + type WrappedError struct + BasicErr BasicError + InnerErr error + func NewWrappedError(basicErr BasicError, innerErr error) *WrappedError + func (w *WrappedError) Error() string v0.1.0 May 11, 2022