-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the `queue` API to the adapter interface. Co-authored-by: Travis Ravert <travert@osc.edu>
- Loading branch information
Showing
7 changed files
with
145 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# frozen_string_literal: true | ||
|
||
# QueueInfo is information about a given queue on a scheduler. | ||
class OodCore::Job::QueueInfo | ||
# The name of the queue. | ||
attr_reader :name | ||
alias to_s name | ||
|
||
# The QoSes associated with this queue | ||
attr_reader :qos | ||
|
||
# The accounts that are allowed to use this queue. | ||
# | ||
# nil means ALL accounts are allowed. | ||
attr_reader :allow_accounts | ||
|
||
# The accounts that are not allowed to use this queue. | ||
attr_reader :deny_accounts | ||
|
||
def initialize(**opts) | ||
@name = opts.fetch(:name, 'unknown') | ||
@qos = opts.fetch(:qos, []) | ||
@allow_accounts = opts.fetch(:allow_accounts, nil) | ||
@deny_accounts = opts.fetch(:deny_accounts, []) | ||
end | ||
|
||
def to_h | ||
instance_variables.map do |var| | ||
name = var.to_s.gsub('@', '').to_sym | ||
[name, send(name)] | ||
end.to_h | ||
end | ||
end |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters