Package: java.util.concurrent

## Interface ExecutorService

- - ### Methods Summary

    Methods
    Return type | Name and parameters
    --- | ---
    `Future` | `submit(Closure task)` Submits a value-returning task for execution and returns a Future representing the pending results of the task.

- - ### Methods Detail

    - #### public Future submit(Closure task)

      Submits a value-returning task for execution and returns a Future representing the pending results of the task.

          def executor = java.util.concurrent.Executors.newSingleThreadExecutor()
          try {
            def future = executor.submit {
              return 'works'
            }
            assert future.get() == 'works'
          } finally {
            executor.shutdown()
          }

      Parameters:
      Since:
        5.0.0