code: public void registerResourceRequest(K key, AsyncResourceRequest<V> resourceRequest) {
          checkNotClosed();
  
          Queue<AsyncResourceRequest<V>> requestQueue = getRequestQueueForKey(key);
          if(requestQueue.isEmpty()) {
              // Attempt non-blocking checkout iff requestQueue is empty.
  
              Pool<V> resourcePool = getResourcePoolForKey(key);
              V resource = null;
              try {
                  resource = attemptNonBlockingCheckout(key, resourcePool);
              } catch(Exception e) {
                  destroyResource(key, resourcePool, resource);
                  resource = null;
                  resourceRequest.handleException(e);
                  return;
              }
              if(resource != null) {
                  resourceRequest.useResource(resource);
                  return;
              }
          }
  
          requestQueue.add(resourceRequest);
          // Guard against (potential) races with checkin by invoking
          // processQueueLoop after resource request has been added to the
          // asynchronous queue.
          processQueueLoop(key);
      }
docs: This method is the asynchronous (nonblocking) version of
  KeyedResourcePool.checkout. This method necessarily has a different
  function declaration (i.e., arguments passed and return type).
  
  This method either checks out a resource and uses that resource or
  enqueues a request to checkout the resource. I.e., there is a
  non-blocking fast-path that is tried optimistically.
  
  @param key The key to checkout the resource for