operateOnResourceWithTimeout<ReturnType> abstract method

Future<void> operateOnResourceWithTimeout<ReturnType>(
  1. OperationOnResource<PoolResourceType, ReturnType> operationOnResource,
  2. Duration timeout
)

Like the operateOnResourceWithoutTimeout, but with a timeout. It will wait until the resource is borrowed or the timeout is reached. Note that the zero duration timeout means wait forever.

Throw CreateResourceFailed if failed to create a new resource.

If the timeout is reached, then throw an exception GetResourceFromPoolTimeout.

Implementation

Future<void> operateOnResourceWithTimeout<ReturnType>(
    OperationOnResource<PoolResourceType, ReturnType> operationOnResource,
    Duration timeout);