code: public CancellableContext withDeadline(Deadline deadline,
        ScheduledExecutorService scheduler) {
      checkNotNull(deadline, "deadline");
      checkNotNull(scheduler, "scheduler");
      return new CancellableContext(this, deadline, scheduler);
    }
docs: Create a new context which will cancel itself at the given {@link Deadline}.
  The returned context will cascade cancellation of its parent. Callers may explicitly cancel
  the returned context prior to the deadline just as for {@link #withCancellation()}. If the unit
  of work completes before the deadline, the context should be explicitly cancelled to allow
  it to be garbage collected.
  
  <p>Sample usage:
  <pre>
  Context.CancellableContext withDeadline = Context.current()
  .withDeadline(someReceivedDeadline, scheduler);
  try {
  withDeadline.run(new Runnable() {
  public void run() {
  Context current = Context.current();
  while (!current.isCancelled() &amp;&amp; moreWorkToDo()) {
  keepWorking();
  }
  }
  });
  } finally {
  withDeadline.cancel(null);
  }
  </pre>