Implement a Method Chaining API with Priority-Based Execution Ordering

Extend the fluent method chaining pattern to support priority annotations on each chained step. When the chain is executed, steps are not run in call order but sorted by their assigned priority (lower number = higher priority). Support both sync and async methods. This tests the intersection of design patterns, priority queues, and async orchestration — the kind of problem asked for Staff/Principal engineer roles in companies building complex UI workflow engines.

Examples
Input: []
Output:
Hints

Implement a Method Chaining API with Priority-Based Execution Ordering

Extend the fluent method chaining pattern to support priority annotations on each chained step. When the chain is executed, steps are not run in call order but sorted by their assigned priority (lower number = higher priority). Support both sync and async methods. This tests the intersection of design patterns, priority queues, and async orchestration — the kind of problem asked for Staff/Principal engineer roles in companies building complex UI workflow engines.