Documentation ¶
Index ¶
- type NotifyResult
- type Option
- func WithBasePath(basePath string) Option
- func WithEngine(engine *gin.Engine) Option
- func WithGlobalErrorHandler(ef func(reqId string, taskPath string, paniced interface{}) error) Option
- func WithLogger(logger *logrus.Logger) Option
- func WithMaxWaitSecondsWhenNotifyErrorBlock(n int) Option
- func WithNotifyErrorFrequencySeconds(n int) Option
- func WithNotifyGoroutineNum(n int) Option
- func WithPort(port string) Option
- func WithRetryNotifyTimes(n int) Option
- type Server
- type TaskHandler
- type TaskHandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NotifyResult ¶
type Option ¶
type Option func(s *Server)
func WithBasePath ¶
func WithEngine ¶
func WithGlobalErrorHandler ¶ added in v1.0.0
func WithGlobalErrorHandler(ef func(reqId string, taskPath string, paniced interface{}) error) Option
全局错误处理。如果ef返回的error不为nil,则会将error信息通知到client
func WithLogger ¶
func WithMaxWaitSecondsWhenNotifyErrorBlock ¶
通知出错时,需要重新通知。如果队列阻塞时,最长等待时间。
func WithNotifyErrorFrequencySeconds ¶
通知出错时,需要重新通知。每n秒,重新通知一次。
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) RegisterTaskHandler ¶
func (s *Server) RegisterTaskHandler(taskPath string, handler TaskHandler)
type TaskHandler ¶
Click to show internal directories.
Click to hide internal directories.