Package org.apache.tapestry5.ioc.services

## Interface ParallelExecutor

- All Known Implementing Classes:
    `NonParallelExecutor`, `ParallelExecutorImpl`

      public interface ParallelExecutor

  A service that allows work to occur in parallel using a thread pool. The thread pool is started lazily, and is shutdown when the Registry is shutdown.
  Since:
    5.1.0.1
  See Also:
    `IOCSymbols`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `<T> T` | `invoke​(java.lang.Class<T> proxyType, Invokable<T> invocable)` | As with `invoke(org.apache.tapestry5.ioc.Invokable)`, but the result is wrapped inside a thunk.
    `<T> java.util.concurrent.Future<T>` | `invoke​(Invokable<T> invocable)` | Submits the invocable object to be executed in a pooled thread.

- - ### Method Detail

    - #### invoke

          <T> java.util.concurrent.Future<T> invoke​(Invokable<T> invocable)

      Submits the invocable object to be executed in a pooled thread. Returns a Future object representing the eventual result of the invocable's operation. The actual operation will be wrapped such that `PerthreadManager.cleanup()` is invoked after the operation completes.
      Type Parameters:
        `T` -
      Parameters:
        `invocable` - to execute in a thread
      Returns:
        Future result of that invocation

    - #### invoke

          <T> T invoke​(java.lang.Class<T> proxyType,
                       Invokable<T> invocable)

      As with `invoke(org.apache.tapestry5.ioc.Invokable)`, but the result is wrapped inside a thunk. Invoking methods on the thunk will block until the value is available.
      Type Parameters:
        `T` -
      Parameters:
        `proxyType` - return type, used to create the thunk
        `invocable` - object that will eventually execute and return a value
      Returns:
        the thunk