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.
47 48 49 |
# File 'lib/docker_cake/registry_api_client.rb', line 47 def initialize @waiters = [] end |
Instance Method Details
#notify(value) ⇒ Object
57 58 59 60 61 |
# File 'lib/docker_cake/registry_api_client.rb', line 57 def notify(value) while waiter = @waiters.shift waiter.notify(value) end end |