Skip to content

Commit

Permalink
protocol decoder: add request reader factory method (#34)
Browse files Browse the repository at this point in the history
Github Issue: #34

Add the factory method to initial decoder to encapsulate the
initialization parameters of request reader those will be added after
this.
  • Loading branch information
y10k committed Feb 28, 2020
1 parent 7574e0b commit bf1c6ad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/rims/protocol/decoder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def self.repl(decoder, limits, input, output, logger)
apply_imap_command.call(:ok_greeting)

conn_timer = ConnectionTimer.new(limits, input.to_io)
request_reader = RequestReader.new(input, output, logger)
request_reader = decoder.make_requrest_reader(input, output)

until (conn_timer.command_wait_timeout?)
conn_timer.command_wait or break
Expand Down Expand Up @@ -341,6 +341,10 @@ def initialize(drb_services, auth, logger,
@logger.debug("RIMS::Protocol::InitialDecoder#initialize at #{self}") if @logger.debug?
end

def make_requrest_reader(input, output)
RequestReader.new(input, output, @logger)
end

def auth?
false
end
Expand Down

0 comments on commit bf1c6ad

Please sign in to comment.