Class: TQ::QueueSpec
Instance Attribute Summary collapse
-
#lease_duration ⇒ Object
readonly
Returns the value of attribute lease_duration.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#max_tasks ⇒ Object
readonly
Returns the value of attribute max_tasks.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(project, location, name, lease_duration: '60s', max_tasks: 1) ⇒ QueueSpec
constructor
A new instance of QueueSpec.
- #queue_name ⇒ Object
Methods included from Utils
Constructor Details
#initialize(project, location, name, lease_duration: '60s', max_tasks: 1) ⇒ QueueSpec
Returns a new instance of QueueSpec.
107 108 109 110 111 112 113 114 |
# File 'lib/tq.rb', line 107 def initialize(project, location, name, lease_duration: '60s', max_tasks: 1) @project = project @location = location @name = name @lease_duration = lease_duration @max_tasks = max_tasks end |
Instance Attribute Details
#lease_duration ⇒ Object (readonly)
Returns the value of attribute lease_duration.
106 107 108 |
# File 'lib/tq.rb', line 106 def lease_duration @lease_duration end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
106 107 108 |
# File 'lib/tq.rb', line 106 def location @location end |
#max_tasks ⇒ Object (readonly)
Returns the value of attribute max_tasks.
106 107 108 |
# File 'lib/tq.rb', line 106 def max_tasks @max_tasks end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
106 107 108 |
# File 'lib/tq.rb', line 106 def name @name end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
106 107 108 |
# File 'lib/tq.rb', line 106 def project @project end |
Class Method Details
.from_hash(data) ⇒ Object
97 98 99 100 101 102 103 104 |
# File 'lib/tq.rb', line 97 def self.from_hash(data) return new( data['project'], data['location'], data['name'], **(['lease_duration','max_tasks'], data) ) end |
Instance Method Details
#queue_name ⇒ Object
116 117 118 |
# File 'lib/tq.rb', line 116 def queue_name "projects/#{project}/locations/#{location}/queues/#{name}" end |