Пример #1
0
func (batch *MemcacheSaveBatch) Commit(emitter stream.Emitter) {
	emitter.Emit(&MemcacheSaveBatch{
		Size:  batch.Size,
		Items: batch.Items,
	})

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

	batch.Keys = []string{}
}
Пример #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)
}
Пример #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{}
}
Пример #5
0
func (batch *batch) Commit(emitter stream.Emitter) {
	emitter.Emit(batch.items)
	batch.items = []stream.T{}
}