Ejemplo n.º 1
0
 def SetMulti(self, mapping):
     futures = []
     for key, value in mapping.items():
         futures.append(db.put_async(PersistentObjectStoreItem.CreateItem(self._namespace, key, value)))
     # If running the dev server, the futures don't complete until the server is
     # *quitting*. This is annoying. Flush now.
     if IsDevServer():
         [future.wait() for future in futures]
 def SetMulti(self, mapping):
   rpcs = [db.put_async(
       PersistentObjectStoreItem.CreateItem(self._namespace, key, value))
       for key, value in mapping.iteritems()]
   # If running the dev server, the futures don't complete until the server is
   # *quitting*. This is annoying. Flush now.
   if IsDevServer():
     [rpc.wait() for rpc in rpcs]
   return All(Future(callback=lambda: rpc.get_result()) for rpc in rpcs)
Ejemplo n.º 3
0
 def SetMulti(self, mapping):
     futures = []
     for key, value in mapping.items():
         futures.append(
             db.put_async(
                 PersistentObjectStoreItem.CreateItem(
                     self._namespace, key, value)))
     # If running the dev server, the futures don't complete until the server is
     # *quitting*. This is annoying. Flush now.
     if IsDevServer():
         [future.wait() for future in futures]
Ejemplo n.º 4
0
 def SetMulti(self, mapping):
     rpcs = [
         db.put_async(
             PersistentObjectStoreItem.CreateItem(self._namespace, key,
                                                  value))
         for key, value in mapping.iteritems()
     ]
     # If running the dev server, the futures don't complete until the server is
     # *quitting*. This is annoying. Flush now.
     if IsDevServer():
         [rpc.wait() for rpc in rpcs]
     return All(Future(callback=lambda: rpc.get_result()) for rpc in rpcs)