Class: A2A::Server::PushConfigStore
- Inherits:
-
Object
- Object
- A2A::Server::PushConfigStore
- Defined in:
- lib/simple_a2a/server/push_config_store.rb
Instance Method Summary collapse
- #delete(task_id) ⇒ Object
- #get(task_id) ⇒ Object
-
#initialize ⇒ PushConfigStore
constructor
A new instance of PushConfigStore.
- #list ⇒ Object
- #set(task_id, config) ⇒ Object
Constructor Details
#initialize ⇒ PushConfigStore
Returns a new instance of PushConfigStore.
6 7 8 9 |
# File 'lib/simple_a2a/server/push_config_store.rb', line 6 def initialize @configs = {} @mutex = Mutex.new end |
Instance Method Details
#delete(task_id) ⇒ Object
20 21 22 |
# File 'lib/simple_a2a/server/push_config_store.rb', line 20 def delete(task_id) @mutex.synchronize { @configs.delete(task_id) } end |
#get(task_id) ⇒ Object
16 17 18 |
# File 'lib/simple_a2a/server/push_config_store.rb', line 16 def get(task_id) @mutex.synchronize { @configs[task_id] } end |
#list ⇒ Object
24 25 26 |
# File 'lib/simple_a2a/server/push_config_store.rb', line 24 def list @mutex.synchronize { @configs.dup } end |
#set(task_id, config) ⇒ Object
11 12 13 14 |
# File 'lib/simple_a2a/server/push_config_store.rb', line 11 def set(task_id, config) @mutex.synchronize { @configs[task_id] = config } config end |