timers

package
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server 代表定时器服务器

func NewServer

func NewServer(logger *log.Logger) *Server

NewServer 创建一个新的 Server 实例

func (*Server) Close

func (s *Server) Close() error

Close 停止所有服务并等待它们完成

func (*Server) Register

func (s *Server) Register(name string, freq time.Duration, handler func(context.Context, map[string]interface{}) (interface{}, error), params map[string]interface{}) error

Register 注册一个新的定时服务

func (*Server) Run

func (s *Server) Run() error

Run 启动所有注册的服务

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL