# uproot.source.futures.ResourceThreadPoolExecutor

Defined in [uproot.source.futures](https://github.com/scikit-hep/uproot5/blob/db953cf9827349b3d24eb6742404158c1dfd5481/src/uproot/source/futures.py) on [line 365](https://github.com/scikit-hep/uproot5/blob/db953cf9827349b3d24eb6742404158c1dfd5481/src/uproot/source/futures.py#L365).

| **Inheritance order:**                                                                                                                                                            |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1. [uproot.ThreadPoolExecutor](uproot.source.futures.ThreadPoolExecutor.html.md)<br/>2. [uproot.source.futures.Executor](uproot.source.futures.Executor.html.md)<br/>3. `abc.ABC` |

### *class* uproot.source.futures.ResourceThreadPoolExecutor(resources)

* **Parameters:**
  **resources** (list of [uproot.source.chunk.Resource](uproot.source.chunk.Resource.html.md)) – Resources to
  wrap as [uproot.source.futures.ResourceFuture](uproot.source.futures.ResourceFuture.html.md) objects.

A [uproot.ThreadPoolExecutor](uproot.source.futures.ThreadPoolExecutor.html.md) whose workers are bound
to resources, such as file handles.

<a id="uproot-source-futures-resourcethreadpoolexecutor-close"></a>

## close

#### ResourceThreadPoolExecutor.close()

Stops all [uproot.source.futures.ResourceWorker](uproot.source.futures.ResourceWorker.html.md) threads and frees
their [resource](uproot.source.futures.ResourceWorker.html.md#uproot-source-futures-resourceworker-resource).

<a id="uproot-source-futures-resourcethreadpoolexecutor-max-workers"></a>

## max_workers

Inherited from [uproot.ThreadPoolExecutor](uproot.source.futures.ThreadPoolExecutor.html.md).

#### ResourceThreadPoolExecutor.max_workers

The maximum number of workers.

<a id="uproot-source-futures-resourcethreadpoolexecutor-num-workers"></a>

## num_workers

Inherited from [uproot.ThreadPoolExecutor](uproot.source.futures.ThreadPoolExecutor.html.md).

#### ResourceThreadPoolExecutor.num_workers

The number of workers.

<a id="uproot-source-futures-resourcethreadpoolexecutor-workers"></a>

## workers

Inherited from [uproot.ThreadPoolExecutor](uproot.source.futures.ThreadPoolExecutor.html.md).

#### ResourceThreadPoolExecutor.workers

A list of workers ([uproot.source.futures.Worker](uproot.source.futures.Worker.html.md)).

<a id="uproot-source-futures-resourcethreadpoolexecutor-submit"></a>

## submit

Inherited from [uproot.source.futures.Executor](uproot.source.futures.Executor.html.md).

#### ResourceThreadPoolExecutor.submit(future: [ResourceFuture](uproot.source.futures.ResourceFuture.html.md#uproot.source.futures.ResourceFuture)) → [ResourceFuture](uproot.source.futures.ResourceFuture.html.md#uproot.source.futures.ResourceFuture)

Pass the `task` onto the workers’
[work_queue](uproot.source.futures.ResourceWorker.html.md#uproot-source-futures-resourceworker-work-queue) as a
[uproot.source.futures.ResourceFuture](uproot.source.futures.ResourceFuture.html.md) so that it will be
executed with its [resource](uproot.source.futures.ResourceWorker.html.md#uproot-source-futures-resourceworker-resource)
when that worker is available.

<a id="uproot-source-futures-resourcethreadpoolexecutor-shutdown"></a>

## shutdown

Inherited from [uproot.source.futures.Executor](uproot.source.futures.Executor.html.md).

#### ResourceThreadPoolExecutor.shutdown(wait: bool = True)

Stop every [uproot.source.futures.Worker](uproot.source.futures.Worker.html.md) by putting one None per
worker on the [work_queue](uproot.source.futures.Worker.html.md#uproot-source-futures-worker-work-queue) and
joining each worker thread.

<a id="uproot-source-futures-resourcethreadpoolexecutor-closed"></a>

## closed

Inherited from [uproot.source.futures.Executor](uproot.source.futures.Executor.html.md).

#### ResourceThreadPoolExecutor.closed

True once the [uproot.source.futures.ResourceWorker](uproot.source.futures.ResourceWorker.html.md) threads have
started stopping; their
[resource](uproot.source.futures.ResourceWorker.html.md#uproot-source-futures-resourceworker-resource) is freed by the
time teardown returns.
