当前位置: 首页>>代码示例>>Golang>>正文


Golang ring.Msg类代码示例

本文整理汇总了Golang中github.com/gholt/ring.Msg的典型用法代码示例。如果您正苦于以下问题:Golang Msg类的具体用法?Golang Msg怎么用?Golang Msg使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Msg类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: MsgToOtherReplicas

func (m *msgRingGroupPullReplicationTester) MsgToOtherReplicas(msg ring.Msg, partition uint32, timeout time.Duration) {
	prm, ok := msg.(*groupPullReplicationMsg)
	if ok {
		m.lock.Lock()
		h := make([]byte, len(prm.header))
		copy(h, prm.header)
		m.headerToPartitions = append(m.headerToPartitions, h)
		b := make([]byte, len(prm.body))
		copy(b, prm.body)
		m.bodyToPartitions = append(m.bodyToPartitions, b)
		m.lock.Unlock()
	}
	msg.Free()
}
开发者ID:creiht,项目名称:valuestore,代码行数:14,代码来源:grouppullreplication_GEN_test.go

示例2: MsgToOtherReplicas

func (m *msgRingPullReplicationTester) MsgToOtherReplicas(ringVersion int64, partition uint32, msg ring.Msg) {
	prm, ok := msg.(*pullReplicationMsg)
	if ok {
		m.lock.Lock()
		h := make([]byte, len(prm.header))
		copy(h, prm.header)
		m.headerToPartitions = append(m.headerToPartitions, h)
		b := make([]byte, len(prm.body))
		copy(b, prm.body)
		m.bodyToPartitions = append(m.bodyToPartitions, b)
		m.lock.Unlock()
	}
	msg.Done()
}
开发者ID:wreese,项目名称:valuestore,代码行数:14,代码来源:pullreplication_test.go

示例3: MsgToNode

func (m *msgRingGroupPullReplicationTester) MsgToNode(msg ring.Msg, nodeID uint64, timeout time.Duration) {
	m.lock.Lock()
	m.msgToNodeIDs = append(m.msgToNodeIDs, nodeID)
	m.lock.Unlock()
	msg.Free()
}
开发者ID:creiht,项目名称:valuestore,代码行数:6,代码来源:grouppullreplication_GEN_test.go

示例4: MsgToOtherReplicas

func (m *msgRingPlaceholder) MsgToOtherReplicas(ringVersion int64, partition uint32, msg ring.Msg) {
	m.lock.Lock()
	m.msgToPartitions = append(m.msgToPartitions, partition)
	m.lock.Unlock()
	msg.Done()
}
开发者ID:wreese,项目名称:valuestore,代码行数:6,代码来源:bulkset_test.go

示例5: MsgToNode

func (m *msgRingPlaceholder) MsgToNode(nodeID uint64, msg ring.Msg) {
	m.lock.Lock()
	m.msgToNodeIDs = append(m.msgToNodeIDs, nodeID)
	m.lock.Unlock()
	msg.Done()
}
开发者ID:wreese,项目名称:valuestore,代码行数:6,代码来源:bulkset_test.go

示例6: MsgToOtherReplicas

func (m *msgRingPlaceholder) MsgToOtherReplicas(msg ring.Msg, partition uint32, timeout time.Duration) {
	m.lock.Lock()
	m.msgToPartitions = append(m.msgToPartitions, partition)
	m.lock.Unlock()
	msg.Free()
}
开发者ID:creiht,项目名称:valuestore,代码行数:6,代码来源:package_test.go

示例7: MsgToNode

func (m *msgRingPlaceholder) MsgToNode(msg ring.Msg, nodeID uint64, timeout time.Duration) {
	m.lock.Lock()
	m.msgToNodeIDs = append(m.msgToNodeIDs, nodeID)
	m.lock.Unlock()
	msg.Free()
}
开发者ID:creiht,项目名称:valuestore,代码行数:6,代码来源:package_test.go

示例8: MsgToNode

func (m *msgRingPullReplicationTester) MsgToNode(nodeID uint64, msg ring.Msg) {
	m.lock.Lock()
	m.msgToNodeIDs = append(m.msgToNodeIDs, nodeID)
	m.lock.Unlock()
	msg.Done()
}
开发者ID:wreese,项目名称:valuestore,代码行数:6,代码来源:pullreplication_test.go


注:本文中的github.com/gholt/ring.Msg类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。