Example #1
0
    def processCommand(self, cmd, keylen, cas, data):
        """Entry point for command processing.  Lower level protocol
        implementations deliver values here."""

        now = time.time()
        while self.sched and self.sched[0][0] <= now:
            print "Running delayed job."
            heapq.heappop(self.sched)[1]()

        hdrs, key, val = self._splitKeys(EXTRA_HDR_FMTS.get(cmd, ""), keylen, data)

        return self.handlers.get(cmd, self.handle_unknown)(cmd, hdrs, key, cas, val)
Example #2
0
    def processCommand(self, cmd, keylen, vb, cas, data):
        """Entry point for command processing.  Lower level protocol
        implementations deliver values here."""

        now = time.time()
        while self.sched and self.sched[0][0] <= now:
            print("Running delayed job.")
            heapq.heappop(self.sched)[1]()

        hdrs, key, val = self._splitKeys(EXTRA_HDR_FMTS.get(cmd, ''), keylen,
                                         data)

        return self.handlers.get(cmd, self.handle_unknown)(cmd, hdrs, key, cas,
                                                           val)