Class THsHaServer


public class THsHaServer extends TNonblockingServer
An extension of the TNonblockingServer to a Half-Sync/Half-Async server. Like TNonblockingServer, it relies on the use of TFramedTransport.
  • Constructor Details

    • THsHaServer

      public THsHaServer(THsHaServer.Args args)
      Create the server with the specified Args configuration
  • Method Details

    • waitForShutdown

      protected void waitForShutdown()
      A method that will block until when threads handling the serving have been shut down.
      Overrides:
      waitForShutdown in class TNonblockingServer
    • createInvokerPool

      protected static ExecutorService createInvokerPool(THsHaServer.Args options)
      Helper to create an invoker pool
    • getInvoker

      protected ExecutorService getInvoker()
    • gracefullyShutdownInvokerPool

      protected void gracefullyShutdownInvokerPool()
    • requestInvoke

      protected boolean requestInvoke(AbstractNonblockingServer.FrameBuffer frameBuffer)
      We override the standard invoke method here to queue the invocation for invoker service instead of immediately invoking. The thread pool takes care of the rest.
      Overrides:
      requestInvoke in class TNonblockingServer
      Returns:
      true if invocation was successfully requested, which is not a guarantee that invocation has completed. False if the request failed.
    • getRunnable

      protected Runnable getRunnable(AbstractNonblockingServer.FrameBuffer frameBuffer)