code: @Override
      public final void run() {
          for (; ; ) {
              final BaasHandler<?> curr = suspendableHandler.get();
              // at this stage we are in the callback thread of execution
              // we get the current handler and choose the state to reach
              if (curr == Signal.COMMITTED) {
                  //the callback has already run
                  // really we don't have to make any work
                  return;
              }
  
              final BaasHandler<?> target;
              if (curr == Signal.SUSPENDED || curr == Signal.DELIVERED) {
                  //if the current state is SUSPENDED the target state
                  //to reach is DELIVERED
                  //handlers in DELIVERED state won't change and remain the same
                  //so for both the cases the target state would be
                  // DELIVERED and there would be no more work to do
                  target = Signal.DELIVERED;
              } else {
                  // we have a real handler to execute
                  // and we need to commit the execution
                  target = Signal.COMMITTED;
              }
  
              if (suspendableHandler.compareAndSet(curr, target)) {
                  //at this point the transition is completed
                  //if the target we reached is COMMITTED than we have
                  //to execute the callback and cleanup the dispatcher
                  if (target == Signal.COMMITTED) {
                      if (curr != null) {
                          ((BaasHandler<R>) curr).handle(result);
                      }
                      finish();
                  }
                  return;
              }
          }
      }
docs: --------------------- Interface Runnable ---------------------