Interface EventLoop

All Known Implementing Classes:
EventLoopBase, NettyEventLoop, NioEventLoop

public interface EventLoop
Aerospike event loop interface.
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    com.aerospike.client.async.EventState
    For internal use only.
    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)
    Retry async batch command.
    int
    Return event loop array index.
    int
    Return the approximate number of commands currently being processed on the event loop.
    int
    Return the approximate number of commands stored on this event loop's delay queue that have not been started yet.
    boolean
    Is current thread the event loop thread.
    void
    schedule(com.aerospike.client.async.ScheduleTask task, long delay, TimeUnit unit)
    Schedule execution with a reusable ScheduleTask.
    void
    schedule(Runnable command, long delay, TimeUnit unit)
    Schedule execution of runnable command with delay.
  • Method Details

    • execute

      void execute(com.aerospike.client.cluster.Cluster cluster, com.aerospike.client.async.AsyncCommand command)
      Execute async command. Execute immediately if in event loop. Otherwise, place command on event loop queue.
    • execute

      void execute(Runnable command)
      Schedule execution of runnable command on event loop. Command is placed on event loop queue and is never executed directly.
    • executeBatchRetry

      void executeBatchRetry(Runnable other, com.aerospike.client.async.AsyncCommand command, long deadline)
      Retry async batch command. For internal use only.
    • schedule

      void schedule(Runnable command, long delay, TimeUnit unit)
      Schedule execution of runnable command with delay.
    • schedule

      void schedule(com.aerospike.client.async.ScheduleTask task, long delay, TimeUnit unit)
      Schedule execution with a reusable ScheduleTask.
    • createConnector

      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.
    • getProcessSize

      int getProcessSize()
      Return the approximate number of commands currently being processed on the event loop. The value is approximate because the call may be from a different thread than the event loop’s thread and there are no locks or atomics used. If accuracy is important and not running in the event loop thread, the slower execute(Runnable) can be called to run this method in the event loop thread.
    • getQueueSize

      int getQueueSize()
      Return the approximate number of commands stored on this event loop's delay queue that have not been started yet. The value is approximate because the call may be from a different thread than the event loop’s thread and there are no locks or atomics used. If accuracy is important and not running in the event loop thread, the slower execute(Runnable) can be called to run this method in the event loop thread.
    • getIndex

      int getIndex()
      Return event loop array index.
    • inEventLoop

      boolean inEventLoop()
      Is current thread the event loop thread. =
    • createState

      com.aerospike.client.async.EventState createState()
      For internal use only.