Enhancement Request: Default Hangfire Queue Name as Class Name for Unattributed Flows*
TheFo2sh opened this issue · comments
Description:
Building upon the proposal to use separate Hangfire queues per flow type, we've further refined the concept to provide even more flexibility and convenience. In scenarios where users do not specify a queue using the proposed QueueAttribute
, we suggest implementing a default behavior. Specifically, when no QueueAttribute
is applied to a flow class, the name of the class itself will be used as the Hangfire queue name.
Feature Details:
-
Default Queue Behavior: If a flow class is not adorned with the
QueueAttribute
, the name of the class will be utilized as the Hangfire queue name. -
Use Cases:
- Prioritization: By using the class name as the queue name, users can implicitly prioritize certain flows by manipulating the order of class names.
- Logical Grouping: Flows that are not assigned a specific queue can still be logically grouped based on their class names.
- Simplified Configuration: Users can leverage this behavior without explicitly applying the
QueueAttribute
, simplifying the configuration process.
-
Example:
If a flow class namedCriticalFlow
is not attributed withQueueAttribute
, the default queue name for this flow will beCriticalFlow
. -
Implementation:
- Modify the
MapFlow
method to automatically determine the Hangfire queue name based on the class name if noQueueAttribute
is applied. - Ensure that this behavior aligns with the broader goal of improving job queue management.
- Modify the
-
Benefits:
- Streamlined Configuration: Users who do not need to explicitly set queue names can rely on the default behavior without additional steps.
- Logical Grouping: Even without attribute configuration, flows can still be logically grouped by queue based on their class names.
- Compatibility: This behavior complements both attributed and non-attributed flows, providing a unified approach.
Your feedback on this refined enhancement proposal is greatly appreciated. Please share your thoughts and considerations regarding the suggested default behavior. If there are any potential concerns or considerations that should be addressed during implementation, kindly let us know. Your input will play a crucial role in shaping this feature for the benefit of AsyncFlow library users.