类 DirectPoller<S>

  • 类型参数:
    S - the type of the result
    所有已实现的接口:
    Poller<S>

    public class DirectPoller<S>
    extends java.lang.Object
    implements Poller<S>
    A Poller that uses the callers thread to poll for a result as soon as it is asked for. This is often appropriate if you expect a result relatively quickly, or if there is only one such result expected (otherwise it is more efficient to use a background thread to do the polling).
    作者:
    Dave Syer
    • 构造器概要

      构造器 
      构造器说明
      DirectPoller​(long interval) 
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型方法说明
      java.util.concurrent.Future<S>poll​(java.util.concurrent.Callable<S> callable)
      Get a future for a non-null result from the callback.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

    • 方法详细资料

      • poll

        public java.util.concurrent.Future<Spoll​(java.util.concurrent.Callable<S> callable)
                                            throws java.lang.Exception
        Get a future for a non-null result from the callback. Only when the result is asked for (using Future.get() or Future.get(long, TimeUnit) will the polling actually start.
        指定者:
        poll 在接口中 Poller<S>
        参数:
        callable - a Callable to use to retrieve a result
        返回:
        a future which itself can be used to get the result
        抛出:
        java.lang.Exception - allows for checked exceptions
        另请参阅:
        Poller.poll(Callable)