longpolling

package
v0.0.0-...-ba2213e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ManyPullRequest

type ManyPullRequest struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL