code: protected Connection createAsyncConnection(Dsn dsn, Connection connection) {
  
          int maxThreads = getAsyncThreads(dsn);
          int priority = getAsyncPriority(dsn);
  
          BlockingDeque<Runnable> queue;
          int queueSize = getAsyncQueueSize(dsn);
          if (queueSize == -1) {
              queue = new LinkedBlockingDeque<>();
          } else {
              queue = new LinkedBlockingDeque<>(queueSize);
          }
  
          ExecutorService executorService = new ThreadPoolExecutor(
              maxThreads, maxThreads, 0L, TimeUnit.MILLISECONDS, queue,
              new DaemonThreadFactory(priority), getRejectedExecutionHandler(dsn));
  
          boolean gracefulShutdown = getAsyncGracefulShutdownEnabled(dsn);
  
          long shutdownTimeout = getAsyncShutdownTimeout(dsn);
          return new AsyncConnection(connection, executorService, gracefulShutdown, shutdownTimeout);
      }
docs: Encapsulates an already existing connection in an {@link AsyncConnection} and get the async options from the
  Sentry DSN.
  
  @param dsn        Data Source Name of the Sentry server.
  @param connection Connection to encapsulate in an {@link AsyncConnection}.
  @return the asynchronous connection.