Documentation
¶
Index ¶
- Constants
- func AddJsonDataToTimerHeap(channel string, data interface{}, time time.Time) error
- func AddManyEventToTimerHeap(event []TimerEvent)
- func AddToTimerHeap(channel string, data string, time time.Time)
- func GetBoolValue(k string) (bool, error)
- func GetJsonValue(k string, data interface{}) error
- func GetValue(k string) (string, error)
- func Pub(channel string, val string) error
- func PubBool(channel string, val bool) error
- func PubBoolQ(channel string, data bool)
- func PubJson(channel string, val interface{}) error
- func PubJsonQ(channel string, data interface{}) error
- func PubQ(channel string, data string)
- func RemValue(k string)
- func RunTimerHeap(ctx context.Context)
- func SetBoolValue(k string, v bool)
- func SetBuffer(count int)
- func SetJsonValue(k string, data interface{})
- func SetTimerHeapHandler(channel string, handler JobHandler)
- func SetValue(k string, v string)
- func Sub(ctx context.Context, channel string, consumer func(*SubCtx))
- type JobHandler
- type JobRouter
- type Queue
- type Sleeper
- type Streamer
- type SubCtx
- type Suber
- type TimerEvent
- type TimerEventHandler
- type TimerEventHeap
- func (h *TimerEventHeap) Extract() (TimerEvent, error)
- func (h *TimerEventHeap) InitEvent(event []TimerEvent)
- func (h *TimerEventHeap) Insert(event TimerEvent)
- func (h TimerEventHeap) Len() int
- func (h TimerEventHeap) Less(i, j int) bool
- func (h *TimerEventHeap) LoadMoreEvent(event []TimerEvent)
- func (h *TimerEventHeap) Pop() interface{}
- func (h *TimerEventHeap) Push(x interface{})
- func (h TimerEventHeap) Swap(i, j int)
- func (h *TimerEventHeap) Update()
- type Value
Constants ¶
View Source
const ( BoolTrue = "True" BoolFalse = "False" )
Variables ¶
This section is empty.
Functions ¶
func AddJsonDataToTimerHeap ¶ added in v0.0.13
add json data to timer heap
func AddManyEventToTimerHeap ¶ added in v0.0.13
func AddManyEventToTimerHeap(event []TimerEvent)
add many event to timer heap, can be used in initializing heap data
func AddToTimerHeap ¶ added in v0.0.13
add channel and data to timer heap
func GetBoolValue ¶ added in v0.0.11
func GetJsonValue ¶ added in v0.0.11
func RunTimerHeap ¶ added in v0.0.13
run timer heap, this will block
func SetBoolValue ¶ added in v0.0.11
func SetJsonValue ¶ added in v0.0.11
func SetJsonValue(k string, data interface{})
func SetTimerHeapHandler ¶ added in v0.0.13
func SetTimerHeapHandler(channel string, handler JobHandler)
set timer heap handler
Types ¶
type JobHandler ¶ added in v0.0.11
type JobHandler func(*SubCtx)
type JobRouter ¶ added in v0.0.13
type JobRouter struct {
Handlers map[string]JobHandler
}
func (*JobRouter) Set ¶ added in v0.0.13
func (r *JobRouter) Set(channel string, handler JobHandler)
type Queue ¶ added in v0.0.11
type Queue struct {
Stream chan string
}
func (*Queue) AppendBool ¶ added in v0.0.11
func (*Queue) AppendJson ¶ added in v0.0.11
type Streamer ¶ added in v0.0.11
func NewStreamer ¶ added in v0.0.11
func NewStreamer() *Streamer
func (*Streamer) Add ¶ added in v0.0.11
func (s *Streamer) Add(name string, handler JobHandler)
type TimerEvent ¶ added in v0.0.13
type TimerEventHandler ¶ added in v0.0.13
type TimerEventHandler func(TimerEvent) error
type TimerEventHeap ¶ added in v0.0.13
type TimerEventHeap struct { Event []TimerEvent Recent int64 Remain int JobRouter }
func NewTimerHeap ¶ added in v0.0.13
func NewTimerHeap() *TimerEventHeap
func (*TimerEventHeap) Extract ¶ added in v0.0.13
func (h *TimerEventHeap) Extract() (TimerEvent, error)
func (*TimerEventHeap) InitEvent ¶ added in v0.0.13
func (h *TimerEventHeap) InitEvent(event []TimerEvent)
func (*TimerEventHeap) Insert ¶ added in v0.0.13
func (h *TimerEventHeap) Insert(event TimerEvent)
func (TimerEventHeap) Len ¶ added in v0.0.13
func (h TimerEventHeap) Len() int
func (TimerEventHeap) Less ¶ added in v0.0.13
func (h TimerEventHeap) Less(i, j int) bool
func (*TimerEventHeap) LoadMoreEvent ¶ added in v0.0.13
func (h *TimerEventHeap) LoadMoreEvent(event []TimerEvent)
func (*TimerEventHeap) Pop ¶ added in v0.0.13
func (h *TimerEventHeap) Pop() interface{}
func (*TimerEventHeap) Push ¶ added in v0.0.13
func (h *TimerEventHeap) Push(x interface{})
func (TimerEventHeap) Swap ¶ added in v0.0.13
func (h TimerEventHeap) Swap(i, j int)
func (*TimerEventHeap) Update ¶ added in v0.0.13
func (h *TimerEventHeap) Update()
type Value ¶ added in v0.0.11
type Value struct {
Data string
}
func (*Value) GetJsonData ¶ added in v0.0.11
Click to show internal directories.
Click to hide internal directories.