Class: Baykit::BayServer::Docker::Fcgi::FcgCommandUnPacker
- Inherits:
-
Protocol::CommandUnPacker
- Object
- Protocol::CommandUnPacker
- Baykit::BayServer::Docker::Fcgi::FcgCommandUnPacker
- Includes:
- Command
- Defined in:
- lib/baykit/bayserver/docker/fcgi/fcg_command_unpacker.rb
Instance Attribute Summary collapse
-
#handler ⇒ Object
readonly
Returns the value of attribute handler.
Instance Method Summary collapse
-
#initialize(handler) ⇒ FcgCommandUnPacker
constructor
A new instance of FcgCommandUnPacker.
- #packet_received(pkt) ⇒ Object
- #reset ⇒ Object
Constructor Details
#initialize(handler) ⇒ FcgCommandUnPacker
Returns a new instance of FcgCommandUnPacker.
14 15 16 17 |
# File 'lib/baykit/bayserver/docker/fcgi/fcg_command_unpacker.rb', line 14 def initialize(handler) @handler = handler reset() end |
Instance Attribute Details
#handler ⇒ Object (readonly)
Returns the value of attribute handler.
12 13 14 |
# File 'lib/baykit/bayserver/docker/fcgi/fcg_command_unpacker.rb', line 12 def handler @handler end |
Instance Method Details
#packet_received(pkt) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/baykit/bayserver/docker/fcgi/fcg_command_unpacker.rb', line 23 def packet_received(pkt) case(pkt.type) when FcgType::BEGIN_REQUEST cmd = CmdBeginRequest.new(pkt.req_id) when FcgType::END_REQUEST cmd = CmdEndRequest.new(pkt.req_id) when FcgType::PARAMS cmd = CmdParams.new(pkt.req_id) when FcgType::STDIN cmd = CmdStdIn.new(pkt.req_id) when FcgType::STDOUT cmd = CmdStdOut.new(pkt.req_id) when FcgType::STDERR cmd = CmdStdErr.new(pkt.req_id) else raise RuntimeError.new("IllegalState") end cmd.unpack(pkt) cmd.handle(handler) end |
#reset ⇒ Object
19 20 21 |
# File 'lib/baykit/bayserver/docker/fcgi/fcg_command_unpacker.rb', line 19 def reset() end |