test
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 263 of file esMonitoring.py.

Constructor & Destructor Documentation

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

Definition at line 264 of file esMonitoring.py.

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

Member Function Documentation

def esMonitoring.FDJsonHandler.handle_line (   self,
  line 
)

Definition at line 270 of file esMonitoring.py.

References esMonitoring.log().

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

Definition at line 288 of file esMonitoring.py.

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

Definition at line 291 of file esMonitoring.py.

292  def writable(self):
293  return False

Member Data Documentation

esMonitoring.FDJsonHandler.es

Definition at line 268 of file esMonitoring.py.

Referenced by esMonitoring.FDJsonServer.handle_accept().