Documentation ¶
Index ¶
- func Retry(times, delay int, f func() bool)
- func RetryError(times, delay int, f func() error)
- func RetryErrorWith(times, delay int, coro Coro)
- func RetryWith[T any](times, delay int, coro Coro)
- func SetEventLoop(loop *AbstractEventLoop)
- func To[S ~[]T, T any](H H, ts ...S) []T
- type AbstractEventLoop
- type Args
- type AsyncEvent
- func (a AsyncEvent) All(handles ...func(*Event)) (delete func())
- func (a AsyncEvent) Dispatch(cmd string, data any)
- func (a AsyncEvent) Heartbeat(initdead, keepalive int, f func(stop func()))
- func (a AsyncEvent) On(name, cmd string, handles ...func(*Event)) func()
- func (a AsyncEvent) OnCommand(cmd string, handles ...func(*Event)) (delete func())
- func (a AsyncEvent) OnRegexp(pattern string, handles ...func(*Event)) (delete func())
- func (a AsyncEvent) Register(name string, choose func(cmd, key string) bool)
- func (a AsyncEvent) Registered(name string) bool
- type Coro
- type Event
- type H
- type Handle
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetEventLoop ¶
func SetEventLoop(loop *AbstractEventLoop)
Types ¶
type AbstractEventLoop ¶
type AbstractEventLoop struct {
// contains filtered or unexported fields
}
func GetEventLoop ¶
func GetEventLoop() *AbstractEventLoop
func NewEventLoop ¶
func NewEventLoop() *AbstractEventLoop
func (*AbstractEventLoop) CreateTask ¶
func (loop *AbstractEventLoop) CreateTask(coro Coro) *Handle
func (*AbstractEventLoop) RunForever ¶
func (loop *AbstractEventLoop) RunForever()
func (*AbstractEventLoop) RunUntilComplete ¶
func (loop *AbstractEventLoop) RunUntilComplete()
type AsyncEvent ¶ added in v0.4.0
type AsyncEvent map[string]model
func (AsyncEvent) All ¶ added in v0.4.0
func (a AsyncEvent) All(handles ...func(*Event)) (delete func())
func (AsyncEvent) Dispatch ¶ added in v0.4.0
func (a AsyncEvent) Dispatch(cmd string, data any)
func (AsyncEvent) Heartbeat ¶ added in v0.5.0
func (a AsyncEvent) Heartbeat(initdead, keepalive int, f func(stop func()))
func (AsyncEvent) On ¶ added in v0.4.0
func (a AsyncEvent) On(name, cmd string, handles ...func(*Event)) func()
func (AsyncEvent) OnCommand ¶ added in v0.4.0
func (a AsyncEvent) OnCommand(cmd string, handles ...func(*Event)) (delete func())
func (AsyncEvent) OnRegexp ¶ added in v0.4.0
func (a AsyncEvent) OnRegexp(pattern string, handles ...func(*Event)) (delete func())
func (AsyncEvent) Register ¶ added in v0.4.0
func (a AsyncEvent) Register(name string, choose func(cmd, key string) bool)
func (AsyncEvent) Registered ¶ added in v0.4.0
func (a AsyncEvent) Registered(name string) bool
type Coro ¶
func NoArgsFunc ¶
Click to show internal directories.
Click to hide internal directories.