Interface GrpcTransportOptions.ExecutorFactory<T extends ExecutorService>

  • Type Parameters:
    T - the ExecutorService subclass created by this factory
    All Known Implementing Classes:
    GrpcTransportOptions.DefaultExecutorFactory
    Enclosing class:
    GrpcTransportOptions

    public static interface GrpcTransportOptions.ExecutorFactory<T extends ExecutorService>
    An interface for ExecutorService factories. Implementations of this interface can be used to provide an user-defined executor to execute requests. Any implementation of this interface must override the get() method to return the desired executor. The release(executor) method should be overriden to free resources used by the executor (if needed) according to application's logic.

    Implementation must provide a public no-arg constructor. Loading of a factory implementation is done via ServiceLoader.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      T get()
      Gets an executor service instance.
      void release​(T executor)
      Releases resources used by the executor and possibly shuts it down.
    • Method Detail

      • get

        T get()
        Gets an executor service instance.
      • release

        void release​(T executor)
        Releases resources used by the executor and possibly shuts it down.