CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 264 of file esMonitoring.py.

Constructor & Destructor Documentation

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

Definition at line 265 of file esMonitoring.py.

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

Member Function Documentation

def esMonitoring.FDJsonHandler.handle_line (   self,
  line 
)

Definition at line 271 of file esMonitoring.py.

References esMonitoring.log().

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

Definition at line 289 of file esMonitoring.py.

290  def handle_write(self):
291  pass
def esMonitoring.FDJsonHandler.writable (   self)

Definition at line 292 of file esMonitoring.py.

293  def writable(self):
294  return False

Member Data Documentation

esMonitoring.FDJsonHandler.es

Definition at line 269 of file esMonitoring.py.

Referenced by esMonitoring.FDJsonServer.handle_accept().