Class: Swarmclient::Communication
- Inherits:
-
Object
- Object
- Swarmclient::Communication
- Defined in:
- lib/swarmclient/pubsub.rb,
lib/swarmclient/communication.rb
Instance Method Summary collapse
- #create(key, value) ⇒ Object
- #has(key) ⇒ Object
-
#initialize(endpoint:, port:, uuid:) ⇒ Communication
constructor
To continue here.
- #keys ⇒ Object
- #read(key) ⇒ Object
- #read_multiple(keys) ⇒ Object
- #remove(key) ⇒ Object
- #subscribe ⇒ Object
- #unsubscribe ⇒ Object
- #update(key, value) ⇒ Object
Constructor Details
#initialize(endpoint:, port:, uuid:) ⇒ Communication
To continue here
7 8 |
# File 'lib/swarmclient/pubsub.rb', line 7 def initialize end |
Instance Method Details
#create(key, value) ⇒ Object
22 23 24 |
# File 'lib/swarmclient/communication.rb', line 22 def create key, value send cmd: 'create', data: { key: key, value: value } end |
#has(key) ⇒ Object
42 43 44 |
# File 'lib/swarmclient/communication.rb', line 42 def has key send cmd: 'has', data: { key: key } end |
#keys ⇒ Object
46 47 48 |
# File 'lib/swarmclient/communication.rb', line 46 def keys send cmd: 'keys', data: nil end |
#read(key) ⇒ Object
26 27 28 |
# File 'lib/swarmclient/communication.rb', line 26 def read key send cmd: 'read', data: { key: key } end |
#read_multiple(keys) ⇒ Object
30 31 32 |
# File 'lib/swarmclient/communication.rb', line 30 def read_multiple keys send_multiple cmd: 'read', keys: keys end |
#remove(key) ⇒ Object
38 39 40 |
# File 'lib/swarmclient/communication.rb', line 38 def remove key send cmd: 'delete', data: { key: key } end |
#subscribe ⇒ Object
10 11 |
# File 'lib/swarmclient/pubsub.rb', line 10 def subscribe end |
#unsubscribe ⇒ Object
13 14 |
# File 'lib/swarmclient/pubsub.rb', line 13 def unsubscribe end |
#update(key, value) ⇒ Object
34 35 36 |
# File 'lib/swarmclient/communication.rb', line 34 def update key, value send cmd: 'update', data: { key: key, value: value } end |