public class RedissonExecutorService extends Object implements RExecutorService
Modifier and Type | Field and Description |
---|---|
static int |
SHUTDOWN_STATE |
static int |
TERMINATED_STATE |
Constructor and Description |
---|
RedissonExecutorService(Codec codec,
CommandExecutor commandExecutor,
Redisson redisson,
String name) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long timeout,
TimeUnit unit) |
boolean |
delete()
Deletes executor request queue and state objects
|
void |
execute(Runnable task) |
String |
getName()
Returns executor name
|
<T> List<Future<T>> |
invokeAll(Collection<? extends Callable<T>> tasks) |
<T> List<Future<T>> |
invokeAll(Collection<? extends Callable<T>> tasks,
long timeout,
TimeUnit unit) |
<T> T |
invokeAny(Collection<? extends Callable<T>> tasks) |
<T> T |
invokeAny(Collection<? extends Callable<T>> tasks,
long timeout,
TimeUnit unit) |
boolean |
isShutdown() |
boolean |
isTerminated() |
void |
registerWorkers(int executors)
Register workers using netty thread-pool to execute each task
|
void |
registerWorkers(int executors,
Executor executor)
Register workers using custom executor to execute each task
|
void |
shutdown() |
List<Runnable> |
shutdownNow() |
<T> Future<T> |
submit(Callable<T> task) |
Future<?> |
submit(Runnable task) |
<T> Future<T> |
submit(Runnable task,
T result) |
public static final int SHUTDOWN_STATE
public static final int TERMINATED_STATE
public RedissonExecutorService(Codec codec, CommandExecutor commandExecutor, Redisson redisson, String name)
public void registerWorkers(int executors)
RExecutorService
registerWorkers
in interface RExecutorService
executors
- - workers amountpublic void registerWorkers(int executors, Executor executor)
RExecutorService
registerWorkers
in interface RExecutorService
executors
- - workers amountpublic void shutdown()
shutdown
in interface ExecutorService
public String getName()
RExecutorService
getName
in interface RExecutorService
public boolean delete()
RExecutorService
delete
in interface RExecutorService
true
if any of objects were deletedpublic List<Runnable> shutdownNow()
shutdownNow
in interface ExecutorService
public boolean isShutdown()
isShutdown
in interface ExecutorService
public boolean isTerminated()
isTerminated
in interface ExecutorService
public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException
awaitTermination
in interface ExecutorService
InterruptedException
public <T> Future<T> submit(Callable<T> task)
submit
in interface ExecutorService
public <T> Future<T> submit(Runnable task, T result)
submit
in interface ExecutorService
public Future<?> submit(Runnable task)
submit
in interface ExecutorService
public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException
invokeAny
in interface ExecutorService
InterruptedException
ExecutionException
public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
invokeAny
in interface ExecutorService
InterruptedException
ExecutionException
TimeoutException
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException
invokeAll
in interface ExecutorService
InterruptedException
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException
invokeAll
in interface ExecutorService
InterruptedException
Copyright © 2014–2016 The Redisson Project. All rights reserved.