Documentation ¶
Index ¶
- Variables
- func PutMsgBatchAllocator(mba *MsgBatchAllocator)
- func PutMsgs(msgs []*Message)
- type CacheType
- type Executor
- type Message
- func (m *Message) Batch() []*Message
- func (m *Message) Err() error
- func (m *Message) IsBatch() bool
- func (m *Message) MarkEnd()
- func (m *Message) MarkRead()
- func (m *Message) MarkStart()
- func (m *Message) MarkWrite()
- func (m *Message) NextReq() (req Request)
- func (m *Message) RemoteDur() time.Duration
- func (m *Message) Request() Request
- func (m *Message) Requests() []Request
- func (m *Message) Reset()
- func (m *Message) ResetSubs()
- func (m *Message) TotalDur() time.Duration
- func (m *Message) WithError(err error)
- func (m *Message) WithRequest(req Request)
- type MsgBatch
- func (m *MsgBatch) AddMsg(msg *Message)
- func (m *MsgBatch) BatchDoneWithError(cluster, addr string, err error)
- func (m *MsgBatch) Buffer() *bufio.Buffer
- func (m *MsgBatch) Count() int
- func (m *MsgBatch) Done(cluster, addr string)
- func (m *MsgBatch) Msgs() []*Message
- func (m *MsgBatch) Nth(i int) *Message
- func (m *MsgBatch) Reset()
- type MsgBatchAllocator
- type MsgChan
- type NodeConn
- type Pinger
- type ProxyConn
- type Request
Constants ¶
This section is empty.
Variables ¶
var (
ErrNoSupportCacheType = errs.New("unsupported cache type")
)
errors
Functions ¶
func PutMsgBatchAllocator ¶ added in v1.3.2
func PutMsgBatchAllocator(mba *MsgBatchAllocator)
PutMsgBatchAllocator all the resource back into pool
Types ¶
type Executor ¶ added in v1.3.2
type Executor interface { Execute(mba *MsgBatchAllocator, msgs []*Message) error Close() error }
Executor is the interface for backend run and process the messages.
type Message ¶
type Message struct { Type CacheType // contains filtered or unexported fields }
Message read from client.
func NewMessage ¶
func NewMessage() *Message
NewMessage will create new message object. this will be used be sub msg req.
func (*Message) MarkEnd ¶
func (m *Message) MarkEnd()
MarkEnd will set the end time of the command to now.
func (*Message) MarkRead ¶
func (m *Message) MarkRead()
MarkRead will set the read time of the command to now.
func (*Message) MarkStart ¶
func (m *Message) MarkStart()
MarkStart will set the start time of the command to now.
func (*Message) MarkWrite ¶
func (m *Message) MarkWrite()
MarkWrite will set the write time of the command to now.
func (*Message) ResetSubs ¶
func (m *Message) ResetSubs()
ResetSubs will return the Msg data to flush and reset
func (*Message) WithRequest ¶
WithRequest with proto request.
type MsgBatch ¶
type MsgBatch struct {
// contains filtered or unexported fields
}
MsgBatch is a single execute unit
func (*MsgBatch) BatchDoneWithError ¶
BatchDoneWithError will set done with error and report prom ErrIncr.
type MsgBatchAllocator ¶ added in v1.3.2
type MsgBatchAllocator struct {
// contains filtered or unexported fields
}
MsgBatchAllocator will manage and allocate the msg batches
func GetMsgBatchAllocator ¶ added in v1.3.2
func GetMsgBatchAllocator() *MsgBatchAllocator
GetMsgBatchAllocator get mb batch allocate.
func (*MsgBatchAllocator) Add ¶ added in v1.3.2
func (m *MsgBatchAllocator) Add(delta int)
Add adds delta, which may be negative, to the WaitGroup counter.
func (*MsgBatchAllocator) AddMsg ¶ added in v1.3.2
func (m *MsgBatchAllocator) AddMsg(node string, msg *Message)
AddMsg will add new msg and create a new batch if node not exists.
func (*MsgBatchAllocator) MsgBatchs ¶ added in v1.3.2
func (m *MsgBatchAllocator) MsgBatchs() map[string]*MsgBatch
MsgBatchs will return the self mbMap for iterator
func (*MsgBatchAllocator) Reset ¶ added in v1.3.2
func (m *MsgBatchAllocator) Reset()
Reset inner MsgBatchs
func (*MsgBatchAllocator) Wait ¶ added in v1.3.2
func (m *MsgBatchAllocator) Wait()
Wait waits until all the message was done
type MsgChan ¶
type MsgChan struct {
// contains filtered or unexported fields
}
MsgChan is queue be used process Msg.
func NewMsgChanBuffer ¶
NewMsgChanBuffer new Msg chan with buffer.