Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrServerIsAlreadyRun = errors.New("server is already run") ErrServerIsNotRun = errors.New("server isn't run") )
Functions ¶
Types ¶
type CallbackFunc ¶
type CallbackOpt ¶
type CallbackOpt interface {
// contains filtered or unexported methods
}
type CallbackWorker ¶
type CallbackWorker struct { RetryOnError bool Retries uint RetryTimeout time.Duration // contains filtered or unexported fields }
func NewCallbackWorker ¶
func NewCallbackWorker(name string, cb CallbackFunc, opts ...CallbackOpt) *CallbackWorker
func (*CallbackWorker) Start ¶
func (w *CallbackWorker) Start() error
func (*CallbackWorker) Stop ¶
func (w *CallbackWorker) Stop() error
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager() *Manager
func NewManagerWithWorkers ¶
type RetryOnErrorOpt ¶
type RetryOnErrorOpt struct { CallbackOpt Timeout time.Duration MaxAttempts int }
type ServerWorker ¶
type ServerWorker struct {
// contains filtered or unexported fields
}
func NewServerWorker ¶
func NewServerWorker(name string, server *http.Server) *ServerWorker
func (*ServerWorker) Start ¶
func (w *ServerWorker) Start() error
func (*ServerWorker) Stop ¶
func (w *ServerWorker) Stop() error
type Worker ¶
type Worker interface { // Start Run worker process in a current goroutine. An implementation // of this method mustn't return the execution context to the caller until finishing Start() error // Stop Graceful stop of the worker process. It have to finish all active // processes and return execution context to the caller. Stop() error }
Click to show internal directories.
Click to hide internal directories.