Exemplo n.º 1
0
// 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)
}
Exemplo n.º 2
0
// 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)
}