接口 WatcherMgr.Watcher<E>

封闭接口:
WatcherMgr<E>

@ThreadSafe public static interface WatcherMgr.Watcher<E>
实现时要小心线程安全问题
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    onEvent(E event)
    onEvent的最好是仅仅将数据传输到监听者线程并唤醒线程,不要执行复杂的逻辑 比如通过future传输数据,监听者在future上阻塞。
    boolean
    test(E event)
    该方法禁止抛出异常,否则可能导致严重错误(事件丢失),可能导致死锁
  • 方法详细资料

    • test

      boolean test(@Nonnull E event)
      该方法禁止抛出异常,否则可能导致严重错误(事件丢失),可能导致死锁
    • onEvent

      void onEvent(@Nonnull E event)
      onEvent的最好是仅仅将数据传输到监听者线程并唤醒线程,不要执行复杂的逻辑 比如通过future传输数据,监听者在future上阻塞。