Class: Isono::Rack::Job::JobResponse
- Defined in:
- lib/isono/rack/job.rb
Instance Attribute Summary collapse
-
#job ⇒ Object
readonly
Returns the value of attribute job.
Attributes inherited from Response
Instance Method Summary collapse
-
#fail_cb(&blk) ⇒ Object
Register call back which called on the job failure.
-
#initialize(ctx, jobctx) ⇒ JobResponse
constructor
A new instance of JobResponse.
-
#response(msg) ⇒ Object
Job may run in asynchronous mode.
Methods inherited from Response
Constructor Details
#initialize(ctx, jobctx) ⇒ JobResponse
Returns a new instance of JobResponse.
13 14 15 16 |
# File 'lib/isono/rack/job.rb', line 13 def initialize(ctx, jobctx) super(ctx) @job = jobctx end |
Instance Attribute Details
#job ⇒ Object (readonly)
Returns the value of attribute job.
9 10 11 |
# File 'lib/isono/rack/job.rb', line 9 def job @job end |
Instance Method Details
#fail_cb(&blk) ⇒ Object
Register call back which called on the job failure.
19 20 21 |
# File 'lib/isono/rack/job.rb', line 19 def fail_cb(&blk) @job.fail_cb = blk end |
#response(msg) ⇒ Object
Job may run in asynchronous mode. So response() should not raise error even when it is called multiple times during session.
25 26 27 28 29 30 31 |
# File 'lib/isono/rack/job.rb', line 25 def response(msg) if responded? Job.logger.info("Defered response message from #{@job.job_id}: #{msg}") else super(msg) end end |