public final class NioEventLoop extends EventLoopBase implements Runnable
Constructor and Description |
---|
NioEventLoop(EventPolicy policy,
SelectorProvider provider,
int index,
boolean daemon,
String poolName)
Construct Aerospike event loop wrapper from NIO Selector.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
static ByteBuffer |
createByteBuffer(int size) |
com.aerospike.client.async.AsyncConnector |
createConnector(com.aerospike.client.cluster.Cluster cluster,
Node node,
com.aerospike.client.async.AsyncConnector.Listener listener)
Create async connector command.
|
void |
execute(com.aerospike.client.cluster.Cluster cluster,
com.aerospike.client.async.AsyncCommand command)
Execute async command.
|
void |
execute(Runnable command)
Schedule execution of runnable command on event loop.
|
void |
executeBatchRetry(Runnable other,
com.aerospike.client.async.AsyncCommand command,
long deadline)
Execute async batch retry.
|
ByteBuffer |
getByteBuffer() |
boolean |
inEventLoop()
Is current thread the event loop thread.
|
void |
putByteBuffer(ByteBuffer byteBuffer) |
void |
run() |
void |
schedule(Runnable command,
long delay,
TimeUnit unit)
Schedule execution of runnable command with delay in milliseconds.
|
void |
schedule(com.aerospike.client.async.ScheduleTask task,
long delay,
TimeUnit unit)
Schedule execution with a reusable ScheduleTask.
|
createState, getIndex, getProcessSize, getQueueSize
public NioEventLoop(EventPolicy policy, SelectorProvider provider, int index, boolean daemon, String poolName) throws IOException
IOException
public void execute(com.aerospike.client.cluster.Cluster cluster, com.aerospike.client.async.AsyncCommand command)
public void execute(Runnable command)
public void executeBatchRetry(Runnable other, com.aerospike.client.async.AsyncCommand command, long deadline)
executeBatchRetry
in interface EventLoop
public void schedule(Runnable command, long delay, TimeUnit unit)
public void schedule(com.aerospike.client.async.ScheduleTask task, long delay, TimeUnit unit)
public com.aerospike.client.async.AsyncConnector createConnector(com.aerospike.client.cluster.Cluster cluster, Node node, com.aerospike.client.async.AsyncConnector.Listener listener)
createConnector
in interface EventLoop
public boolean inEventLoop()
inEventLoop
in interface EventLoop
public static ByteBuffer createByteBuffer(int size)
public ByteBuffer getByteBuffer()
public void putByteBuffer(ByteBuffer byteBuffer)
public void close()
Copyright © 2012–2021 Aerospike, Inc. All rights reserved.