code: private void flushQueue() {
          while (true) {
              final Action act = firstNonNull(actionQueue.poll(), new Action(Actions.END, null));
              switch (act.action) {
                  case POST: post(act.object); break;
                  case REGISTER: register(act.object); break;
                  case UNREGISTER: unregister(act.object); break;
                  case END: default: return;
              }
          }
      }
docs: Flushes the queue