'Put an item into the queue, perhaps waiting until there is room.
Returns a Future, which raises `tornado.gen.TimeoutError` after a
timeout.'

def put(self, item, timeout=None):

    try:
        self.put_nowait(item)
    except QueueFull:
        future = Future()
        self._putters.append((item, future))
        _set_timeout(future, timeout)
        return future
    else:
        return gen._null_future
