Example #1
0
func (batch *MemcacheSaveBatch) Commit(emitter stream.Emitter) {
	emitter.Emit(&MemcacheSaveBatch{
		Size:  batch.Size,
		Items: batch.Items,
	})

	batch.Items = []*memcache.Item{}
}
Example #2
0
func (batch *MemcacheDeleteBatch) Commit(emitter stream.Emitter) {
	emitter.Emit(&MemcacheDeleteBatch{
		Size: batch.Size,
		Keys: batch.Keys,
	})

	batch.Keys = []string{}
}
Example #3
0
func (batch *MemcacheLoadBatch) Commit(emitter stream.Emitter) {
	emitter.Emit(&MemcacheLoadBatch{
		Size:  batch.Size,
		Keys:  batch.Keys,
		Items: batch.Items,
	})

	batch.Keys = []string{}
	batch.Items = make(map[string]*CachedEntity)
}
Example #4
0
func (batch *DatastoreBatch) Commit(emitter stream.Emitter) {
	emitter.Emit(&DatastoreBatch{
		Size:  batch.Size,
		Keys:  batch.Keys,
		Items: batch.Items,
	})

	batch.Items = []Entity{}
	batch.Keys = []*datastore.Key{}
}
Example #5
0
func (batch *batch) Commit(emitter stream.Emitter) {
	emitter.Emit(batch.items)
	batch.items = []stream.T{}
}