code: public void shutdown(long quietPeriod, long timeout, TimeUnit timeUnit) {
  
          // disable all resources to benefit from concurrent shutdowns
          for (QueueListener<K, V> resource : resources) {
              resource.disable();
          }
  
          for (QueueListener<K, V> resource : resources) {
              resource.close(timeout, timeUnit);
          }
          resources.clear();
  
          if (!sharedClient) {
              disqueClient.shutdown(quietPeriod, timeout, timeUnit);
          }
      }
docs: Shut down the {@link QueueListenerFactory} and close all open connections. Shared clients are not shut down by this
  method. The instance should be discarded after calling shutdown.
  
  @param quietPeriod the quiet period as described in the documentation
  @param timeout the maximum amount of time to wait until the executor is shutdown regardless if a task was submitted
  during the quiet period
  @param timeUnit the unit of {@code quietPeriod} and {@code timeout}