Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-40943

change '*' observer priority handling

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • 2.6
    • 2.6
    • Events API
    • BACKEND Sprint 3

      At present we calculate the priority of "" and observers of individual events together, I would like to propose to always first execute all "" ordered by priority and then all other observers sorted separately by priority.

      benefits:
      1/ tiny bit faster when constructing the nested array of observers
      2/ tiny less memory used because the cached list of handlers would be smaller ('*' would not be repeated)
      3/ this would allow us to introduce observing of parent class events without breaking BC (if we ever want that in the future)

      problems:
      1/ specific observers could not be executed first and '*' could not be last

      The priority was introduced in order to allow the logging subsystems to process events as the first observer to eliminate data modifications from previous handlers. So far we did not find any other major use cases for the priority flag in observers - ideas?

            skodak Petr Skoda
            skodak Petr Skoda
            Sam Hemelryk Sam Hemelryk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.