Class: Swarmclient::Communication

Inherits:
Object
  • Object
show all
Defined in:
lib/swarmclient/pubsub.rb,
lib/swarmclient/communication.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_limitObject

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_timeoutObject

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

#keysObject



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

#sizeObject



55
56
57
# File 'lib/swarmclient/communication.rb', line 55

def size
  send cmd: 'size', data: nil
end

#subscribeObject



10
11
# File 'lib/swarmclient/pubsub.rb', line 10

def subscribe
end

#unsubscribeObject



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