Class ExecutionContextBuilder
- java.lang.Object
-
- io.servicetalk.transport.netty.internal.ExecutionContextBuilder
-
public final class ExecutionContextBuilder extends java.lang.Object
A builder ofExecutionContext
. If any of the components ofExecutionContext
is not provided, then the corresponding component fromGlobalExecutionContext
will be chosen. If none of the components are provided thenGlobalExecutionContext.globalExecutionContext()
will be returned.
-
-
Constructor Summary
Constructors Constructor Description ExecutionContextBuilder()
New instance.ExecutionContextBuilder(ExecutionContextBuilder other)
Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExecutionContextBuilder
bufferAllocator(BufferAllocator allocator)
Sets theBufferAllocator
to use.ExecutionContext
build()
Builds a newExecutionContext
or returnGlobalExecutionContext.globalExecutionContext()
if none of the components are set in this builder.ExecutionContextBuilder
executionStrategy(ExecutionStrategy strategy)
Sets theExecutionStrategy
to use.ExecutionContextBuilder
executor(Executor executor)
Sets theExecutor
to use.ExecutionContextBuilder
ioExecutor(IoExecutor ioExecutor)
Sets theIoExecutor
to use.
-
-
-
Constructor Detail
-
ExecutionContextBuilder
public ExecutionContextBuilder()
New instance.
-
ExecutionContextBuilder
public ExecutionContextBuilder(ExecutionContextBuilder other)
Copy constructor.- Parameters:
other
- existingExecutionContextBuilder
to copy the config from.
-
-
Method Detail
-
ioExecutor
public ExecutionContextBuilder ioExecutor(IoExecutor ioExecutor)
Sets theIoExecutor
to use.- Parameters:
ioExecutor
-IoExecutor
to use.- Returns:
this
.
-
executor
public ExecutionContextBuilder executor(Executor executor)
Sets theExecutor
to use.- Parameters:
executor
-Executor
to use.- Returns:
this
.
-
bufferAllocator
public ExecutionContextBuilder bufferAllocator(BufferAllocator allocator)
Sets theBufferAllocator
to use.- Parameters:
allocator
-BufferAllocator
to use.- Returns:
this
.
-
executionStrategy
public ExecutionContextBuilder executionStrategy(ExecutionStrategy strategy)
Sets theExecutionStrategy
to use.- Parameters:
strategy
-ExecutionStrategy
to use.- Returns:
this
.
-
build
public ExecutionContext build()
Builds a newExecutionContext
or returnGlobalExecutionContext.globalExecutionContext()
if none of the components are set in this builder.- Returns:
ExecutionContext
.
-
-