Class: Arcp::Job::Handle
- Inherits:
-
Data
- Object
- Data
- Arcp::Job::Handle
- Defined in:
- lib/arcp/job/handle.rb
Instance Attribute Summary collapse
-
#agent ⇒ Object
readonly
Returns the value of attribute agent.
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
-
#job_id ⇒ Object
readonly
Returns the value of attribute job_id.
-
#lease ⇒ Object
readonly
Returns the value of attribute lease.
-
#submitted_at ⇒ Object
readonly
Returns the value of attribute submitted_at.
Instance Method Summary collapse
- #cancel(client:, reason: nil) ⇒ Object
- #credential_for(endpoint:) ⇒ Object
- #get_result(client:) ⇒ Object
-
#initialize(job_id:, agent:, submitted_at:, lease: nil, credentials: nil) ⇒ Handle
constructor
A new instance of Handle.
- #subscribe(client:, **kw) ⇒ Object
Constructor Details
#initialize(job_id:, agent:, submitted_at:, lease: nil, credentials: nil) ⇒ Handle
Returns a new instance of Handle.
6 7 8 |
# File 'lib/arcp/job/handle.rb', line 6 def initialize(job_id:, agent:, submitted_at:, lease: nil, credentials: nil) super end |
Instance Attribute Details
#agent ⇒ Object (readonly)
Returns the value of attribute agent
5 6 7 |
# File 'lib/arcp/job/handle.rb', line 5 def agent @agent end |
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials
5 6 7 |
# File 'lib/arcp/job/handle.rb', line 5 def credentials @credentials end |
#job_id ⇒ Object (readonly)
Returns the value of attribute job_id
5 6 7 |
# File 'lib/arcp/job/handle.rb', line 5 def job_id @job_id end |
#lease ⇒ Object (readonly)
Returns the value of attribute lease
5 6 7 |
# File 'lib/arcp/job/handle.rb', line 5 def lease @lease end |
#submitted_at ⇒ Object (readonly)
Returns the value of attribute submitted_at
5 6 7 |
# File 'lib/arcp/job/handle.rb', line 5 def submitted_at @submitted_at end |
Instance Method Details
#cancel(client:, reason: nil) ⇒ Object
11 |
# File 'lib/arcp/job/handle.rb', line 11 def cancel(client:, reason: nil) = client.cancel_job(job_id: job_id, reason: reason) |
#credential_for(endpoint:) ⇒ Object
13 |
# File 'lib/arcp/job/handle.rb', line 13 def credential_for(endpoint:) = Array(credentials).find { |credential| credential.endpoint == endpoint } |
#get_result(client:) ⇒ Object
12 |
# File 'lib/arcp/job/handle.rb', line 12 def get_result(client:) = client.get_result(job_id: job_id) |
#subscribe(client:, **kw) ⇒ Object
10 |
# File 'lib/arcp/job/handle.rb', line 10 def subscribe(client:, **kw) = client.subscribe_job(job_id: job_id, **kw) |