3 Replies Latest reply on Jul 20, 2009 6:10 PM by Pete Muir

    How to add an asynchronous observer via Event<T> interface?

    Federico Dal Maso Newbie

      In last spec it seems to be impossible to register via Event interface an asynchronous observer.
      It is possible for a method invocation, via


      in event param.

      public interface Event<T> {
          public void fire(T event);
          public void addObserver(Observer<T> observer);
          public void removeObserver(Observer<T> observer);
          public Event<T> select(Annotation... bindings);
          public <U extends T> Event<U> select(Class<U> subtype, Annotation... bindings);
          public <U extends T> Event<U> select(TypeLiteral<U> subtype, Annotation... bindings);

      maybe we need of a method overload like this

      public void addObserver(Observer<T> observer, Notify type);