docs: public final void close()
      {
          try
          {
              if (!isClosed)
              {
                  isRunning = false;
                  isClosed = true;
                  agent.onClose();
              }
          }
          catch (final Throwable throwable)
          {
              errorHandler.onError(throwable);
          }
      }