// 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) }
// 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) }
// Close client and all its active connection with downstream. // asynchronous call. func (c *Client) Close() error { cmd := []interface{}{clientCmdClose} return common.FailsafeOpAsync(c.reqch, cmd, c.finch) }
// WaitForExit will block until endpoint exits. func (endpoint *RouterEndpoint) WaitForExit() error { return c.FailsafeOpAsync(nil, []interface{}{}, endpoint.finch) }
// SyncPulse will trigger vb-routine to generate a sync pulse for this // vbucket, asychronous call. func (vr *VbucketRoutine) SyncPulse() error { cmd := []interface{}{vrCmdSyncPulse} return c.FailsafeOpAsync(vr.reqch, cmd, vr.finch) }
// Event will post an DcpEvent, asychronous call. func (vr *VbucketRoutine) Event(m *mc.DcpEvent) error { cmd := []interface{}{vrCmdEvent, m} return c.FailsafeOpAsync(vr.reqch, cmd, vr.finch) }