예제 #1
0
// Publish attaches an autoincrementing index to the message.
// This function also execute's the client's PublishFunc mock function.
func (c *MessagingClient) Publish(m *messaging.Message) (uint64, error) {
	c.mu.Lock()
	defer c.mu.Unlock()
	c.index++
	m.Index = c.index
	return c.PublishFunc(m)
}
예제 #2
0
파일: server_test.go 프로젝트: pcn/influxdb
// Publish attaches an autoincrementing index to the message.
// This function also execute's the client's PublishFunc mock function.
func (c *MessagingClient) Publish(m *messaging.Message) (uint64, error) {
	c.index++
	m.Index = c.index
	return c.PublishFunc(m)
}