Class: RegistryApiClient::PubSub
- Inherits:
-
Object
- Object
- RegistryApiClient::PubSub
- Defined in:
- lib/docker_cake/registry_api_client.rb
Overview
It’s same as waiter but support multiple subscribers
Instance Method Summary collapse
-
#initialize ⇒ PubSub
constructor
A new instance of PubSub.
- #notify(value) ⇒ Object
- #wait ⇒ Object
Constructor Details
#initialize ⇒ PubSub
Returns a new instance of PubSub.
57 58 59 |
# File 'lib/docker_cake/registry_api_client.rb', line 57 def initialize @waiters = [] end |
Instance Method Details
#notify(value) ⇒ Object
67 68 69 70 71 |
# File 'lib/docker_cake/registry_api_client.rb', line 67 def notify(value) while waiter = @waiters.shift waiter.notify(value) end end |