func RunPusher(c *api.SyncGatewayClient, channel string, size, seqId, sleepTime int, wg *sync.WaitGroup) { defer wg.Done() for doc := range DocIterator(seqId*DocsPerUser, (seqId+1)*DocsPerUser, size, channel) { revsDiff := map[string][]string{ doc.Id: []string{doc.Rev}, } c.PostRevsDiff(revsDiff) docs := map[string]interface{}{ "docs": []api.Doc{doc}, "new_edits": false, } c.PostBulkDocs(docs) time.Sleep(time.Duration(sleepTime) * time.Millisecond) } }