CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
esMonitoring.FDJsonHandler Class Reference
Inheritance diagram for esMonitoring.FDJsonHandler:
esMonitoring.AsyncLineReaderMixin

Public Member Functions

def __init__
 
def handle_line
 
def handle_write
 
def writable
 
- Public Member Functions inherited from esMonitoring.AsyncLineReaderMixin
def __init__
 
def handle_close
 
def handle_line
 
def handle_read
 

Public Attributes

 es
 
- Public Attributes inherited from esMonitoring.AsyncLineReaderMixin
 line_buf
 not needed, since asyncore automatically handles close if len(rbuf) == 0: self.handle_close() return More...
 

Detailed Description

Definition at line 262 of file esMonitoring.py.

Constructor & Destructor Documentation

def esMonitoring.FDJsonHandler.__init__ (   self,
  sock,
  es 
)

Definition at line 263 of file esMonitoring.py.

264  def __init__(self, sock, es):
265  AsyncLineReaderMixin.__init__(self)
266  asyncore.dispatcher.__init__(self, sock)
268  self.es = es

Member Function Documentation

def esMonitoring.FDJsonHandler.handle_line (   self,
  line 
)

Definition at line 269 of file esMonitoring.py.

References esMonitoring.log().

270  def handle_line(self, line):
271  if len(line) < 4:
272  # keep alive 'ping'
273  self.es.try_update()
274  return
275 
276  try:
277  doc = json.loads(line)
278 
279  for k in ["pid", "run", "lumi"]:
280  if doc.has_key(k):
281  doc[k] = int(doc[k])
282 
283  self.es.update_doc_recursive(self.es.doc, doc)
284  self.es.try_update()
285  except:
286  log("cannot deserialize json len: %d content: %s" % (len(line), line))
def esMonitoring.FDJsonHandler.handle_write (   self)

Definition at line 287 of file esMonitoring.py.

288  def handle_write(self):
289  pass
def esMonitoring.FDJsonHandler.writable (   self)

Definition at line 290 of file esMonitoring.py.

291  def writable(self):
292  return False

Member Data Documentation

esMonitoring.FDJsonHandler.es

Definition at line 267 of file esMonitoring.py.

Referenced by esMonitoring.FDJsonServer.handle_accept().