org.apache.ignite.internal.util.worker

## Class GridWorkerPool

- java.lang.Object
- - org.apache.ignite.internal.util.worker.GridWorkerPool

    public class GridWorkerPool
    extends Object

Pool of runnable workers. This class automatically takes care of error handling that has to do with executing a runnable task and ensures that all tasks are finished when stop occurs.

### Constructor Summary

Constructors
Constructor and Description
`GridWorkerPool(Executor exec, IgniteLogger log)`

### Method Summary

Methods
`void` `execute(GridWorker w)` Schedules runnable task for execution.
`void` `join(boolean cancel)` Waits for all workers to finish.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### GridWorkerPool

    public GridWorkerPool(Executor exec,
                  IgniteLogger log)

Parameters:
  `exec` - Executor service.
  `log` - Logger to use.

### Method Detail

#### execute

    public void execute(GridWorker w)
                 throws IgniteCheckedException

Schedules runnable task for execution.

Parameters:
  `w` - Runnable task.
Throws:
  `IgniteCheckedException` - Thrown if any exception occurred.

#### join

    public void join(boolean cancel)

Waits for all workers to finish.

Parameters:
  `cancel` - Flag to indicate whether workers should be cancelled before waiting for them to finish.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.8.0
Release Date | : December 5 2016