code: func (s *MemoryStore) ApplyStoreActions(actions []api.StoreAction) error {
  	s.updateLock.Lock()
  	memDBTx := s.memDB.Txn(true)
  
  	tx := tx{
  		readTx: readTx{
  			memDBTx: memDBTx,
  		},
  	}
  
  	for _, sa := range actions {
  		if err := applyStoreAction(&tx, sa); err != nil {
  			memDBTx.Abort()
  			s.updateLock.Unlock()
  			return err
  		}
  	}
  
  	memDBTx.Commit()
  
  	for _, c := range tx.changelist {
  		s.queue.Publish(c)
  	}
  	if len(tx.changelist) != 0 {
  		s.queue.Publish(state.EventCommit{})
  	}
  	s.updateLock.Unlock()
  	return nil
  }
docs: // ApplyStoreActions updates a store based on StoreAction messages.