Class: Rubcask::Server::Pipeline

Inherits:
Object
  • Object
show all
Includes:
Protocol
Defined in:
lib/rubcask/server/pipeline.rb

Overview

Note:

Pipeline execution IS NOT atomic.

Pipeline represents a sequence of commands.

See Also:

Constant Summary

Constants included from Protocol

Protocol::ERROR, Protocol::NIL, Protocol::OK, Protocol::PING, Protocol::PONG, Protocol::SEPARATOR

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Protocol

create_call_message, encode_message, error_message, nil_message, ok_message, ping_message, pong_message

Constructor Details

#initializePipeline

Returns a new instance of Pipeline.



16
17
18
19
# File 'lib/rubcask/server/pipeline.rb', line 16

def initialize
  @out = (+"").b
  @count = 0
end

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



14
15
16
# File 'lib/rubcask/server/pipeline.rb', line 14

def count
  @count
end

#outObject (readonly)

Returns the value of attribute out.



14
15
16
# File 'lib/rubcask/server/pipeline.rb', line 14

def out
  @out
end

Instance Method Details

#del(key) ⇒ Object

See Also:



32
33
34
# File 'lib/rubcask/server/pipeline.rb', line 32

def del(key)
  @out << create_call_message("del", key)
end

#get(key) ⇒ Object

See Also:



22
23
24
# File 'lib/rubcask/server/pipeline.rb', line 22

def get(key)
  @out << create_call_message("get", key)
end

#pingObject

See Also:



37
38
39
# File 'lib/rubcask/server/pipeline.rb', line 37

def ping
  @out << create_call_message("ping")
end

#set(key, value) ⇒ Object

See Also:



27
28
29
# File 'lib/rubcask/server/pipeline.rb', line 27

def set(key, value)
  @out << create_call_message("set", key, value)
end