-
Notifications
You must be signed in to change notification settings - Fork 22
Fairness Keys & Weights #322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| :priority_key | ||
| :priority_key, | ||
| :fairness_key, | ||
| :weight |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You called this fairness_weight in Python
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, dumb oversight
| # 3. The default weight of 1.0 will be used. | ||
| # | ||
| # Weight values are clamped to the range [0.001, 1000]. | ||
| class Priority |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So in Python you want priority_key to be provided on constructor, but have fairness_key and weight be optional? If so, you need to add an initialize in here that has the default params you want and calls super
| attr_reader weight: Float? | ||
|
|
||
| def initialize: (priority_key: Integer?) -> void | ||
| def initialize: (priority_key: Integer?, ?fairness_key: String?, ?weight: Float?) -> void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mentioned in other comment, but you'll need to write initialize if you want optional parameters (the default initialize of Data does not support default parameters, but it's easy to write yourself and call super)
|
|
||
| # Initialize a new Priority instance. | ||
| # | ||
| # @param priority_key [Integer] The priority key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # @param priority_key [Integer] The priority key | |
| # @param priority_key [Integer, nil] The priority key |
What was changed
Added fairness keys/weights to priority
Why?
New feature
Checklist
Closes
How was this tested:
Added test
Any docs updates needed?