@Override
    protected Procedure[] execute(final TestProcEnv env) throws ProcedureSuspendedException {
      LOG.info("EXECUTE " + this + " ntimeouts=" + ntimeouts);
      if (ntimeouts.get() > maxTimeouts) {
        setAbortFailure("test", "give up after " + ntimeouts.get());
        return null;
      }

      event.suspend();
      if (event.suspendIfNotReady(this)) {
        setState(ProcedureState.WAITING_TIMEOUT);
        throw new ProcedureSuspendedException();
      }

      return null;
    }
This Event+Procedure exhibits following behavior:
<ul>
<li>On procedure execute()
<ul>
<li>If had enough timeouts, abort the procedure. Else....</li>
<li>Suspend the event and add self to its suspend queue</li>
<li>Go into waiting state</li>
</ul>
</li>
<li>On waiting timeout
<ul>
<li>Wake the event (which adds this procedure back into scheduler queue), and set own's state
to RUNNABLE (so can be executed again).</li>
</ul>
</li>
</ul>
hbase-procedure/src/test/java/org/apache/hadoop/hbase/procedure2/TestProcedureEvents.java