Class: Delayer::Deferred::Request::Await

Inherits:
Base
  • Object
show all
Defined in:
lib/delayer/deferred/request.rb

Overview

Chainable#[email protected] が呼ばれた時に、一旦そこで処理を止めるためのリクエスト。 value には、実行完了を待つDeferredが入っている。

わかりやすい!

accept_requestメソッドの引数のdeferred {
  +value
}

Instance Attribute Summary

Attributes inherited from Base

#value

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Delayer::Deferred::Request::Base

Instance Method Details

#accept_request(worker:, deferred:) ⇒ Object


41
42
43
44
# File 'lib/delayer/deferred/request.rb', line 41

def accept_request(worker:, deferred:)
  deferred.enter_await
  foreign_deferred.add_child(Delayer::Deferred::Chain::Await.new(worker: worker, deferred: deferred))
end