Class: Rubcask::Server::Pipeline
- Inherits:
-
Object
- Object
- Rubcask::Server::Pipeline
- Includes:
- Protocol
- Defined in:
- lib/rubcask/server/pipeline.rb
Overview
Note:
Pipeline execution IS NOT atomic.
Pipeline represents a sequence of commands.
Constant Summary
Constants included from Protocol
Protocol::ERROR, Protocol::NIL, Protocol::OK, Protocol::PING, Protocol::PONG, Protocol::SEPARATOR
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#out ⇒ Object
readonly
Returns the value of attribute out.
Instance Method Summary collapse
- #del(key) ⇒ Object
- #get(key) ⇒ Object
-
#initialize ⇒ Pipeline
constructor
A new instance of Pipeline.
- #ping ⇒ Object
- #set(key, value) ⇒ Object
Methods included from Protocol
create_call_message, encode_message, error_message, nil_message, ok_message, ping_message, pong_message
Constructor Details
#initialize ⇒ Pipeline
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
#count ⇒ Object (readonly)
Returns the value of attribute count.
14 15 16 |
# File 'lib/rubcask/server/pipeline.rb', line 14 def count @count end |
#out ⇒ Object (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
32 33 34 |
# File 'lib/rubcask/server/pipeline.rb', line 32 def del(key) @out << ("del", key) end |
#get(key) ⇒ Object
22 23 24 |
# File 'lib/rubcask/server/pipeline.rb', line 22 def get(key) @out << ("get", key) end |
#ping ⇒ Object
37 38 39 |
# File 'lib/rubcask/server/pipeline.rb', line 37 def ping @out << ("ping") end |
#set(key, value) ⇒ Object
27 28 29 |
# File 'lib/rubcask/server/pipeline.rb', line 27 def set(key, value) @out << ("set", key, value) end |