Documentation ¶
Index ¶
- type ManyPullRequest
- type PullRequest
- type PullRequestTable
- func (table *PullRequestTable) Get(k string) *ManyPullRequest
- func (table *PullRequestTable) Put(k string, v *ManyPullRequest)
- func (table *PullRequestTable) PutIfAbsent(k string, v *ManyPullRequest) *ManyPullRequest
- func (table *PullRequestTable) Remove(k string) *ManyPullRequest
- func (table *PullRequestTable) Size() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ManyPullRequest ¶
ManyPullRequest 长轮询请求 Author rongzhihong Since 2017/9/5
func (*ManyPullRequest) AddManyPullRequest ¶
func (req *ManyPullRequest) AddManyPullRequest(mpr []*PullRequest)
AddManyPullRequest 插入请求列表 Author rongzhihong Since 2017/9/5
func (*ManyPullRequest) AddPullRequest ¶
func (req *ManyPullRequest) AddPullRequest(pullRequest *PullRequest)
AddPullRequest 插入请求 Author rongzhihong Since 2017/9/5
func (*ManyPullRequest) CloneListAndClear ¶
func (req *ManyPullRequest) CloneListAndClear() []*PullRequest
CloneListAndClear 克隆并清空请求列表 Author rongzhihong Since 2017/9/5
type PullRequest ¶
type PullRequest struct { RequestCommand *protocol.RemotingCommand Context netm.Context TimeoutMillis int64 SuspendTimestamp int64 PullFromThisOffset int64 }
PullRequest 拉消息请求 Author gaoyanlei Since 2017/8/18
func NewPullRequest ¶
func NewPullRequest(requestCommand *protocol.RemotingCommand, ctx netm.Context, timeoutMillis, suspendTimestamp, pullFromThisOffset int64) *PullRequest
type PullRequestTable ¶
type PullRequestTable struct { PullRequestMap map[string]*ManyPullRequest // key:topic@queueId sync.RWMutex }
PullRequestTable 消息集合 Author rongzhihong Since 2017/9/5
func NewPullRequestTable ¶
func NewPullRequestTable() *PullRequestTable
newPullRequestTable 初始化消息集合 Author rongzhihong Since 2017/9/5
func (*PullRequestTable) Get ¶
func (table *PullRequestTable) Get(k string) *ManyPullRequest
get 获得key对应的value Author rongzhihong Since 2017/9/5
func (*PullRequestTable) Put ¶
func (table *PullRequestTable) Put(k string, v *ManyPullRequest)
put 存放消息 Author rongzhihong Since 2017/9/5
func (*PullRequestTable) PutIfAbsent ¶
func (table *PullRequestTable) PutIfAbsent(k string, v *ManyPullRequest) *ManyPullRequest
putIfAbsent 不存在时,才存放消息 Author rongzhihong Since 2017/9/5
func (*PullRequestTable) Remove ¶
func (table *PullRequestTable) Remove(k string) *ManyPullRequest
remove 删除消息 Author rongzhihong Since 2017/9/5
func (*PullRequestTable) Size ¶
func (table *PullRequestTable) Size() int
size 消息集合长度 Author rongzhihong Since 2017/9/5