Esempio n. 1
0
 def put(self, request, context):
     print(("Saving data into the DB, key=%s\n%s" %
            (request.id, request.data)))
     key = request.id
     value = request.data
     self.map[key] = value
     return db_pb2.PutResponse(id=key)
    def put(self, request, context):
        print "Saving data into the DB...\n", request.data
        # key = uuid.uuid4().hex

        # print "================="
        # print "This is request: "
        # print request
        # print "This is request.data.entry content "
        # for key in request.data.entry:
        #     print key
        #     print request.data.entry[key]
        # print context
        # print "================="
        value = request.data
        key = request.data.entry['id']
        self.map[key] = value
        return db_pb2.PutResponse(id=key)
Esempio n. 3
0
 def put(self, request, context):
     print "Saving data into the DB...\n", request.data
     key = uuid.uuid4().hex
     value = request.data
     self.map[key] = value
     return db_pb2.PutResponse(id=key)