Top Description Inners Methods
org.eclipse.jetty.util.thread

public Interface ExecutionStrategy

Known Direct Implementers
org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy, org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume, org.eclipse.jetty.util.thread.strategy.ProduceConsume, org.eclipse.jetty.util.thread.strategy.ProduceExecuteConsume

An ExecutionStrategy executes Runnable tasks produced by a Producer. The strategy to execute the task may vary depending on the implementation; the task may be run in the calling thread, or in a new thread, etc.

The strategy delegates the production of tasks to a Producer, and continues to execute tasks until the producer continues to produce them.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
ExecutionStrategy.Producer

A producer of Runnable tasks to run.

Method Summary

Modifier and TypeMethod and Description
public void
dispatch()

Initiates (or resumes) the task production and consumption.

public void
produce()

Initiates (or resumes) the task production and consumption.

Method Detail

dispatchback to summary
public void dispatch()

Initiates (or resumes) the task production and consumption.

This method guarantees that the task is never run by the thread that called this method.

TODO review the need for this (only used by HTTP2 push)
See Also
produce()
produceback to summary
public void produce()

Initiates (or resumes) the task production and consumption.

The produced task may be run by the same thread that called this method.

See Also
dispatch()
org.eclipse.jetty.util.thread back to summary

public Interface ExecutionStrategy.Producer


A producer of Runnable tasks to run.

The ExecutionStrategy will repeatedly invoke produce() until the producer returns null, indicating that it has nothing more to produce.

When no more tasks can be produced, implementations should arrange for the ExecutionStrategy to be invoked again in case an external event resumes the tasks production.

Method Summary

Modifier and TypeMethod and Description
public Runnable

Returns:

a task to executed or null if there are no more tasks to execute
produce
()

Produces a task to be executed.

Method Detail

produceback to summary
public Runnable produce()

Produces a task to be executed.

Returns:Runnable

a task to executed or null if there are no more tasks to execute