Class: Swarmclient::Communication
- Inherits:
-
Object
- Object
- Swarmclient::Communication
- Defined in:
- lib/swarmclient/pubsub.rb,
lib/swarmclient/communication.rb
Instance Attribute Summary collapse
-
#transaction_id_limit ⇒ Object
Returns the value of attribute transaction_id_limit.
-
#ws_set_timeout ⇒ Object
Returns the value of attribute ws_set_timeout.
Instance Method Summary collapse
- #create(key, value) ⇒ Object
- #has(key) ⇒ Object
-
#initialize(endpoint: DEFAULT_IP, port: DEFAULT_PORT, uuid: DEFAULT_UUID, secure: false) ⇒ Communication
constructor
To continue here.
- #keys ⇒ Object
- #read(key) ⇒ Object
- #remove(key) ⇒ Object
- #size ⇒ Object
- #subscribe ⇒ Object
- #unsubscribe ⇒ Object
- #update(key, value) ⇒ Object
Constructor Details
#initialize(endpoint: DEFAULT_IP, port: DEFAULT_PORT, uuid: DEFAULT_UUID, secure: false) ⇒ Communication
To continue here
7 8 |
# File 'lib/swarmclient/pubsub.rb', line 7 def initialize end |
Instance Attribute Details
#transaction_id_limit ⇒ Object
Returns the value of attribute transaction_id_limit.
17 18 19 |
# File 'lib/swarmclient/communication.rb', line 17 def transaction_id_limit @transaction_id_limit end |
#ws_set_timeout ⇒ Object
Returns the value of attribute ws_set_timeout.
17 18 19 |
# File 'lib/swarmclient/communication.rb', line 17 def ws_set_timeout @ws_set_timeout end |
Instance Method Details
#create(key, value) ⇒ Object
31 32 33 |
# File 'lib/swarmclient/communication.rb', line 31 def create key, value send cmd: 'create', data: { key: key, value: value.to_s } end |
#has(key) ⇒ Object
47 48 49 |
# File 'lib/swarmclient/communication.rb', line 47 def has key send cmd: 'has', data: { key: key } end |
#keys ⇒ Object
51 52 53 |
# File 'lib/swarmclient/communication.rb', line 51 def keys send cmd: 'keys', data: nil end |
#read(key) ⇒ Object
35 36 37 |
# File 'lib/swarmclient/communication.rb', line 35 def read key send cmd: 'read', data: { key: key } end |
#remove(key) ⇒ Object
43 44 45 |
# File 'lib/swarmclient/communication.rb', line 43 def remove key send cmd: 'delete', data: { key: key } end |
#size ⇒ Object
55 56 57 |
# File 'lib/swarmclient/communication.rb', line 55 def size send cmd: 'size', data: nil 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
39 40 41 |
# File 'lib/swarmclient/communication.rb', line 39 def update key, value send cmd: 'update', data: { key: key, value: value.to_s } end |