Problem/Motivation
RegisterServicesForDestructionPass::process does not support a priority attribute. Being unable to set certain services to be destroyed after others has caused the following issue: https://www.drupal.org/project/purge/issues/3008776
The Purge Queue service's destruct method is called before Search API's, resulting in certain tags not getting added to Purge's queue for invalidation.
Proposed resolution
The fix is simple enough, just sort the list before adding the registerService method. We can't take the approach used by, for example, BreadcrumbManager and simply key them by their priority because "priority" is an optional key (otherwise all modules implementing this tag would need to update).
If this gets in, Purge can add priority key and fix the aforementioned bug.
Remaining tasks
User interface changes
N/a
API changes
@todo
Data model changes
N/a
Release notes snippet
@todo