def run0(self):
if self.current:<EOL><INDENT>self.inactive = <NUM_LIT:0><EOL>callback, args, kwds = self.current.popleft()<EOL>_logging_debug('<STR_LIT>', callback.__name__)<EOL>callback(*args, **kwds)<EOL>return <NUM_LIT:0><EOL><DEDENT>if self.run_idle():<EOL><INDENT>return <NUM_LIT:0><EOL><DEDENT>delay = None<EOL>if self.queue:<EOL><INDENT>delay = self.queue[<NUM_LIT:0>][<NUM_LIT:0>] - self.clock.now()<EOL>if delay <= <NUM_LIT:0>:<EOL><INDENT>self.inactive = <NUM_LIT:0><EOL>_, callback, args, kwds = self.queue.pop(<NUM_LIT:0>)<EOL>_logging_debug('<STR_LIT>', callback.__name__)<EOL>callback(*args, **kwds)<EOL>return <NUM_LIT:0><EOL><DEDENT><DEDENT>if self.rpcs:<EOL><INDENT>self.inactive = <NUM_LIT:0><EOL>rpc = datastore_rpc.MultiRpc.wait_any(self.rpcs)<EOL>if rpc is not None:<EOL><INDENT>_logging_debug('<STR_LIT>', rpc.service, rpc.method)<EOL>if rpc not in self.rpcs:<EOL><INDENT>raise RuntimeError('<STR_LIT>' %<EOL>(rpc, self.rpcs))<EOL><DEDENT>callback, args, kwds = self.rpcs[rpc]<EOL>del self.rpcs[rpc]<EOL>if callback is not None:<EOL><INDENT>callback(*args, **kwds)<EOL><DEDENT><DEDENT>return <NUM_LIT:0><EOL><DEDENT>return delay<EOL>
Run one item (a callback or an RPC wait_any).

        Returns:
          A time to sleep if something happened (may be 0);
          None if all queues are empty.