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 ConsumeQueue(ctx context.Context)
- 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 PubJson(channel string, val interface{}) error
- func PubJsonQueue(channel string, data interface{}) error
- func PubQueue(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{}) error
- func SetQueueBuffer(b int)
- func SetQueueHandler(channel string, handler JobHandler)
- func SetTimerHeapHandler(channel string, handler JobHandler)
- func SetValue(k string, v string)
- func Sub(ctx context.Context, channel string, consumer func(*SubCtx))
- type ChannelData
- type ChannelQueue
- type JobHandler
- type JobRouter
- type Sleeper
- 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 ConsumeQueue ¶ added in v0.0.17
func GetBoolValue ¶ added in v0.0.11
func GetJsonValue ¶ added in v0.0.11
func PubJsonQueue ¶ added in v0.0.17
pub json data to queue
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 SetQueueBuffer ¶ added in v0.0.17
func SetQueueBuffer(b int)
func SetQueueHandler ¶ added in v0.0.17
func SetQueueHandler(channel string, handler JobHandler)
set queue handler
func SetTimerHeapHandler ¶ added in v0.0.13
func SetTimerHeapHandler(channel string, handler JobHandler)
set timer heap handler
Types ¶
type ChannelData ¶ added in v0.0.17
func GetChannelDataFromJson ¶ added in v0.0.17
func GetChannelDataFromJson(j string) (*ChannelData, error)
type ChannelQueue ¶ added in v0.0.17
type ChannelQueue struct { JobRouter DataChannel chan ChannelData Mtx sync.RWMutex }
func NewChannelQueue ¶ added in v0.0.17
func NewChannelQueue(buffer int) *ChannelQueue
new channel queue
func (*ChannelQueue) Consume ¶ added in v0.0.17
func (queue *ChannelQueue) Consume(ctx context.Context)
consume
func (*ChannelQueue) Pub ¶ added in v0.0.17
func (queue *ChannelQueue) Pub(channelData ChannelData)
insert data
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 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.