Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-2432

enhance distributed executor service with submit(Task, Address...)

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Duplicate
    • Minor
    • 5.2.0.Final
    • 5.2.0.Beta2
    • Clustered Executor
    • None

    Description

      as discussed with vladimir on user forum it would be nice to add to the DistributedExecutorService interface (or Advanced interface) a capability to submit a task to a particular address(es).

      my use case was to propagate a cdi event to all other members to the cluster as the local dispatch was already ensured with @Observes.

      basically I wanted to do the following :

      @Inject Event<MyEventThatIWantToPropagateThatExtendsBaseEvent> myEvent;
      myEvent.fire(new MyEvent());
      
      @Inject BeanManager beanManager;
      onBaseEvent(@Observes final BaseEvent event){
        List<Address> addresses = getAllOtherNodes();
        DistributedExecutorService.submit(new Callable<Void>({
          public Void run() throws Exception{
            beanManager.fireEvent(event);
          }
        }), addresses);
      }
      
      onMyEvent(@Observes final MyEvent event){
        System.out.println("this will be executed locally and on all other members of the cluster");
      }
      

      Attachments

        Activity

          People

            vblagoje Vladimir Blagojevic (Inactive)
            mathieu@mathieulachance.com Mathieu Lachance (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: