Documentation ¶
Index ¶
- Constants
- func ExitBrokers()
- func InitBroker()
- func SetWorker(workerId string, worker *Worker)
- type Broker
- type Endian
- type IBackendWriter
- type Item
- type MinHeap
- func (mh MinHeap) Len() int
- func (mh MinHeap) Less(i, j int) bool
- func (mh *MinHeap) PeekEl() *MinHeapElement
- func (mh *MinHeap) Pop() interface{}
- func (mh *MinHeap) PopEl() *MinHeapElement
- func (mh *MinHeap) Push(x interface{})
- func (mh *MinHeap) PushEl(el *MinHeapElement)
- func (mh *MinHeap) RemoveEl(el *MinHeapElement)
- func (mh MinHeap) Swap(i, j int)
- func (mh *MinHeap) UpdateEl(el *MinHeapElement, priority int64)
- type MinHeapElement
- type MsgPayload
- type Worker
- type WorkerGroup
Constants ¶
View Source
const ( WorkerTypeConcurrent = 1 WorkerTypeSerial = 2 WorkerTypeAsync = 3 )
Variables ¶
This section is empty.
Functions ¶
func ExitBrokers ¶
func ExitBrokers()
func InitBroker ¶
func InitBroker()
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
func GetOrCreateBroker ¶
func (*Broker) GetConsumeWorker ¶
type IBackendWriter ¶
type Item ¶
type Item struct { Sequence uint64 HashCode uint64 CreatedAt uint32 //Partition uint32 Offset uint32 Size uint32 RetryCount uint32 DelayType uint32 DelayValue uint32 Priority int64 Data []byte }
func (*Item) Marshal2Data ¶
func (*Item) Marshal2Index ¶
type MinHeap ¶
type MinHeap []*MinHeapElement
MinHeap A PriorityQueue implements heap.Interface and holds Items.
func NewMinHeap ¶
func NewMinHeap() *MinHeap
func (*MinHeap) PeekEl ¶
func (mh *MinHeap) PeekEl() *MinHeapElement
func (*MinHeap) PopEl ¶
func (mh *MinHeap) PopEl() *MinHeapElement
func (*MinHeap) PushEl ¶
func (mh *MinHeap) PushEl(el *MinHeapElement)
func (*MinHeap) RemoveEl ¶
func (mh *MinHeap) RemoveEl(el *MinHeapElement)
func (*MinHeap) UpdateEl ¶
func (mh *MinHeap) UpdateEl(el *MinHeapElement, priority int64)
UpdateEl update modifies the priority and value of an Item in the queue.
type MinHeapElement ¶
type MinHeapElement struct { Value interface{} Priority int64 // The priority of the item in the queue. // contains filtered or unexported fields }
An MinHeapElement is something we manage in a priority queue.
type MsgPayload ¶
type MsgPayload struct { //Ctx *MsgPayload_Context `protobuf:"bytes,1,opt,name=ctx" json:"ctx,omitempty"` MsgId string `protobuf:"bytes,2,opt,name=msg_id,json=msgId" json:"msg_id,omitempty"` Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` DelayType uint32 DelayValue uint32 }
func DecodeMsgPayload ¶
func DecodeMsgPayload(buf []byte) (*MsgPayload, error)
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
func (*Worker) ReceiveItem ¶
type WorkerGroup ¶
type WorkerGroup struct {
// contains filtered or unexported fields
}
func NewWorkerGroup ¶
func NewWorkerGroup(topic string, cfg *config.SubCfg) *WorkerGroup
func (*WorkerGroup) GetOrCreateWorker ¶
func (g *WorkerGroup) GetOrCreateWorker(workerId string) *Worker
func (*WorkerGroup) RemoveWorker ¶
func (g *WorkerGroup) RemoveWorker(workerId string)
func (*WorkerGroup) SetLatestFileSequence ¶
func (g *WorkerGroup) SetLatestFileSequence(sequence uint64)
func (*WorkerGroup) Start ¶
func (g *WorkerGroup) Start() error
func (*WorkerGroup) Stop ¶
func (g *WorkerGroup) Stop()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.