docs: public void run()
      {
          try
          {
              if (!thread.compareAndSet(null, Thread.currentThread()))
              {
                  return;
              }
  
              final IdleStrategy idleStrategy = this.idleStrategy;
              final Agent agent = this.agent;
              try
              {
                  agent.onStart();
              }
              catch (final Throwable throwable)
              {
                  errorHandler.onError(throwable);
                  isRunning = false;
              }
  
              while (isRunning)
              {
                  if (doDutyCycle(idleStrategy, agent))
                  {
                      break;
                  }
              }
  
              try
              {
                  agent.onClose();
              }
              catch (final Throwable throwable)
              {
                  errorHandler.onError(throwable);
              }
          }
          finally
          {
              isClosed = true;
          }
      }