本文整理汇总了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()
}
示例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()
}
示例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()
}
示例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()
}
示例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()
}
示例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()
}
示例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()
}
示例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()
}