Uploaded image for project: 'CDI Specification Issues'
  1. CDI Specification Issues
  2. CDI-541

Ordering of async observers (vs sync observers) is not specified

    Details

    • Type: Feature Request
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0-EDR1
    • Fix Version/s: 2.1 (Discussion)
    • Component/s: Events
    • Labels:
      None

      Description

      I think this needs to be specified. E.g. what happens if I fire async event and have more matching sync and async observers? Are all sync observes called first in given order with no regard to async observers priority?
      For example:
      event.fireAsync(new Message());

      public class First {
        
         void observeMessage(@Observes @Priority(2000) Message message){} 
      }
      
      public class Second {
        
         void observeMessage(@ObservesAsync @Priority(2100) Message message){} 
      }
      
      public class Third {
        
         void observeMessage(@Observes @Priority(2200) Message message){} 
      }
      
      public class Fourth {
        
         void observeMessage(@ObservesAsync @Priority(2300) Message message){} 
      }
      

      What will be the order in this case? First, Third, Second, Fourth?

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  tremes Tomas Remes
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated: