Class: Pmux::Gateway::ClientContext

Inherits:
Object
  • Object
show all
Defined in:
lib/pmux-gw/client_context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request, response, mapper, command, detect_error) ⇒ ClientContext

処理に必要なクライアントの情報を保持するクラス



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/pmux-gw/client_context.rb', line 5

def initialize request, response, mapper, command, detect_error
  @request = request
  @response = response
  @mapper = mapper
  @command = command
  @detect_error = detect_error
  @stdout_data = ""
  @stderr_data = ""
  @pmux_terminated = false
  @force_pmux_terminated = false
  @content_too_big = false
  @pid = nil
  @start_datetime = nil
  @end_datetime = nil
  @peername = nil
  @user = nil
  @status = "init"
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



36
37
38
# File 'lib/pmux-gw/client_context.rb', line 36

def command
  @command
end

#content_too_bigObject

Returns the value of attribute content_too_big.



37
38
39
# File 'lib/pmux-gw/client_context.rb', line 37

def content_too_big
  @content_too_big
end

#detect_errorObject (readonly)

Returns the value of attribute detect_error.



36
37
38
# File 'lib/pmux-gw/client_context.rb', line 36

def detect_error
  @detect_error
end

#end_datetimeObject

Returns the value of attribute end_datetime.



37
38
39
# File 'lib/pmux-gw/client_context.rb', line 37

def end_datetime
  @end_datetime
end

#force_pmux_terminatedObject

Returns the value of attribute force_pmux_terminated.



37
38
39
# File 'lib/pmux-gw/client_context.rb', line 37

def force_pmux_terminated
  @force_pmux_terminated
end

#mapperObject (readonly)

Returns the value of attribute mapper.



36
37
38
# File 'lib/pmux-gw/client_context.rb', line 36

def mapper
  @mapper
end

#peernameObject

Returns the value of attribute peername.



37
38
39
# File 'lib/pmux-gw/client_context.rb', line 37

def peername
  @peername
end

#pidObject

Returns the value of attribute pid.



37
38
39
# File 'lib/pmux-gw/client_context.rb', line 37

def pid
  @pid
end

#pmux_handlerObject (readonly)

Returns the value of attribute pmux_handler.



36
37
38
# File 'lib/pmux-gw/client_context.rb', line 36

def pmux_handler
  @pmux_handler
end

#pmux_terminatedObject

Returns the value of attribute pmux_terminated.



37
38
39
# File 'lib/pmux-gw/client_context.rb', line 37

def pmux_terminated
  @pmux_terminated
end

#requestObject (readonly)

Returns the value of attribute request.



36
37
38
# File 'lib/pmux-gw/client_context.rb', line 36

def request
  @request
end

#responseObject (readonly)

Returns the value of attribute response.



36
37
38
# File 'lib/pmux-gw/client_context.rb', line 36

def response
  @response
end

#start_datetimeObject

Returns the value of attribute start_datetime.



37
38
39
# File 'lib/pmux-gw/client_context.rb', line 37

def start_datetime
  @start_datetime
end

#statusObject

Returns the value of attribute status.



37
38
39
# File 'lib/pmux-gw/client_context.rb', line 37

def status
  @status
end

#stderr_dataObject (readonly)

Returns the value of attribute stderr_data.



36
37
38
# File 'lib/pmux-gw/client_context.rb', line 36

def stderr_data
  @stderr_data
end

#stdout_dataObject (readonly)

Returns the value of attribute stdout_data.



36
37
38
# File 'lib/pmux-gw/client_context.rb', line 36

def stdout_data
  @stdout_data
end

#userObject

Returns the value of attribute user.



37
38
39
# File 'lib/pmux-gw/client_context.rb', line 37

def user
  @user
end

Instance Method Details

#append_stderr_data(data) ⇒ Object



32
33
34
# File 'lib/pmux-gw/client_context.rb', line 32

def append_stderr_data data
  @stderr_data << data
end

#append_stdout_data(data) ⇒ Object



28
29
30
# File 'lib/pmux-gw/client_context.rb', line 28

def append_stdout_data data
  @stdout_data << data
end

#set_pmux_handler(pmux_handler) ⇒ Object



24
25
26
# File 'lib/pmux-gw/client_context.rb', line 24

def set_pmux_handler pmux_handler
  @pmux_handler = pmux_handler
end