Class: Baykit::BayServer::Docker::Cgi::CgiStdErrShip

Inherits:
Common::ReadOnlyShip
  • Object
show all
Includes:
Agent, Util
Defined in:
lib/baykit/bayserver/docker/cgi/cgi_std_err_ship.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCgiStdErrShip

Returns a new instance of CgiStdErrShip.



17
18
19
20
# File 'lib/baykit/bayserver/docker/cgi/cgi_std_err_ship.rb', line 17

def initialize
  super
  reset()
end

Instance Attribute Details

#handlerObject (readonly)

Returns the value of attribute handler.



15
16
17
# File 'lib/baykit/bayserver/docker/cgi/cgi_std_err_ship.rb', line 15

def handler
  @handler
end

Instance Method Details

#check_timeout(duration_sec) ⇒ Object



69
70
71
72
# File 'lib/baykit/bayserver/docker/cgi/cgi_std_err_ship.rb', line 69

def check_timeout(duration_sec)
  BayLog.debug("%s stderr Check timeout: tur=%s dur=%d", self, @tour, duration_sec)
  return @handler.timed_out()
end

#init_std_err(rd, agt_id, handler) ⇒ Object



22
23
24
25
# File 'lib/baykit/bayserver/docker/cgi/cgi_std_err_ship.rb', line 22

def init_std_err(rd, agt_id, handler)
  init(agt_id, rd, nil)
  @handler = handler
end

#notify_closeObject



64
65
66
67
# File 'lib/baykit/bayserver/docker/cgi/cgi_std_err_ship.rb', line 64

def notify_close()
  BayLog.debug("%s CGI stderr notifyClose tur=%s", self, @tour)
  @handler.std_err_closed()
end

#notify_eofObject



59
60
61
62
# File 'lib/baykit/bayserver/docker/cgi/cgi_std_err_ship.rb', line 59

def notify_eof()
  BayLog.debug("%s CGI stderr EOF\\(^o^)/ tur=%s", self, @tour)
  return NextSocketAction::CLOSE
end

#notify_error(e) ⇒ Object



55
56
57
# File 'lib/baykit/bayserver/docker/cgi/cgi_std_err_ship.rb', line 55

def notify_error(e)
  BayLog.debug_e(e)
end

#notify_read(buf) ⇒ Object

implements ReadOnlyShip



44
45
46
47
48
49
50
51
52
53
# File 'lib/baykit/bayserver/docker/cgi/cgi_std_err_ship.rb', line 44

def notify_read(buf)

  BayLog.debug("%s CGI StdErr %d bytesd", self, buf.length)
  if(buf.length() > 0)
    BayLog.error("CGI Stderr: %s", buf)
  end

  return NextSocketAction::CONTINUE;

end

#resetObject

implements Reusable



35
36
37
38
# File 'lib/baykit/bayserver/docker/cgi/cgi_std_err_ship.rb', line 35

def reset()
  super
  @handler = nil
end

#to_sObject



27
28
29
# File 'lib/baykit/bayserver/docker/cgi/cgi_std_err_ship.rb', line 27

def to_s()
  return "agt#{@agent_id} err_ship#{@ship_id}/#{@object_id}";
end