Documentation
¶
Overview ¶
Package workerpoolhttp - реализация очереди http-запросов с обработкой переполнения
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
OptsRequiredErr = errors.New("opts required")
)
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct {
W http.ResponseWriter
R *http.Request
Handler http.Handler
// contains filtered or unexported fields
}
Job - таск по обработке http запроса
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue - очередь http-запросов
func NewQueue ¶
func NewQueue(opts *QueueOptions) (*Queue, error)
type QueueOptions ¶
type QueueOptions struct {
QueueSize int // Размер очереди
Timeout time.Duration // Таймаут добавления в очередь
OverflowCode int // Статус код ошибки переполнения очереди
OverflowMsg proto.Message // Сообщение о переполнении
OverflowMsgProto, OverflowMsgJson []byte // Сериализованное сообщение о переполнении
}
QueueOptions - опции очереди
Click to show internal directories.
Click to hide internal directories.