コード例 #1
0
ファイル: endpoint.go プロジェクト: jchris/indexing
// Send KeyVersions to other end, asynchronous call.
// Asynchronous call. Return ErrorChannelFull that can be used by caller.
func (endpoint *RouterEndpoint) Send(data interface{}) error {
	cmd := []interface{}{endpCmdSend, data}
	if endpoint.block {
		return c.FailsafeOpAsync(endpoint.ch, cmd, endpoint.finch)
	}
	return c.FailsafeOpNoblock(endpoint.ch, cmd, endpoint.finch)
}
コード例 #2
0
ファイル: client.go プロジェクト: jchris/indexing
// SendKeyVersions for one or more vbuckets to the other end,
// asynchronous call.
func (c *Client) SendKeyVersions(vbs []*common.VbKeyVersions, block bool) error {
	if vbs == nil || len(vbs) == 0 {
		return ErrorClientEmptyKeys
	}
	cmd := []interface{}{clientCmdSendKeyVersions, vbs}
	if block {
		return common.FailsafeOpAsync(c.reqch, cmd, c.finch)
	}
	return common.FailsafeOpNoblock(c.reqch, cmd, c.finch)
}