ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
python.messaging_listen.ATLASDQMListener Class Reference
Inheritance diagram for python.messaging_listen.ATLASDQMListener:
Collaboration diagram for python.messaging_listen.ATLASDQMListener:

Public Member Functions

def __init__ (self, listener, dest='/topic/atlas.dqm.progress', selector=None)
 
def __enter__ (self)
 
def __enter61__ (self)
 
def __exit__ (self, eType, eValue, eTrace)
 

Public Attributes

 listener
 
 dest
 
 selector
 
 conns
 

Detailed Description

Definition at line 13 of file messaging_listen.py.

Constructor & Destructor Documentation

◆ __init__()

def python.messaging_listen.ATLASDQMListener.__init__ (   self,
  listener,
  dest = '/topic/atlas.dqm.progress',
  selector = None 
)

Definition at line 14 of file messaging_listen.py.

14  def __init__(self, listener, dest='/topic/atlas.dqm.progress',
15  selector=None):
16  self.listener = listener
17  self.dest = dest
18  self.selector = selector
19 

Member Function Documentation

◆ __enter61__()

def python.messaging_listen.ATLASDQMListener.__enter61__ (   self)

Definition at line 27 of file messaging_listen.py.

27  def __enter61__(self):
28  serverlist=[_[4] for _ in socket.getaddrinfo(MSGSERVER, MSGPORT,
29  socket.AF_INET,
30  socket.SOCK_STREAM)]
31 
32  from . import stompconfig
33  self.conns = []
34  if hasattr(self.listener, 'conn'):
35  self.listener.conn=[]
36  for svr in serverlist:
37  auth = stompconfig.config()
38  cfg = {}
39  cfg['heartbeats'] = (0,0)
40  cfg['reconnect_attempts_max'] = 3
41  conn=stomp.Connection([svr], **cfg)
42  conn.set_listener('somename',self.listener)
43  if hasattr(self.listener, 'conn'):
44  self.listener.conn.append(conn)
45  conn.connect(wait=True, **auth)
46  hdr = {}
47  if self.selector is not None: hdr['selector'] = self.selector
48  if hasattr(self.listener, 'ack_mode'):
49  ack_mode=self.listener.ack_mode
50  else:
51  ack_mode='auto'
52  conn.subscribe(destination=self.dest, ack=ack_mode, headers = hdr, id=len(self.conns))
53  self.conns.append(conn)
54  return self
55 

◆ __enter__()

def python.messaging_listen.ATLASDQMListener.__enter__ (   self)

Definition at line 20 of file messaging_listen.py.

20  def __enter__(self):
21  if stomp.__version__ >= (6,1,0):
22  return self.__enter61__()
23  else:
24  logging.critical("Unable to find stomp.py >= 6.1.0, can't proceed")
25  raise ValueError("Version of stomp.py is too old")
26 

◆ __exit__()

def python.messaging_listen.ATLASDQMListener.__exit__ (   self,
  eType,
  eValue,
  eTrace 
)

Definition at line 56 of file messaging_listen.py.

56  def __exit__(self, eType, eValue, eTrace):
57  for conn in self.conns:
58  try:
59  conn.disconnect()
60  except Exception as e:
61  print('Exception closing connections:' + repr(e))
62  pass
63  return False

Member Data Documentation

◆ conns

python.messaging_listen.ATLASDQMListener.conns

Definition at line 33 of file messaging_listen.py.

◆ dest

python.messaging_listen.ATLASDQMListener.dest

Definition at line 16 of file messaging_listen.py.

◆ listener

python.messaging_listen.ATLASDQMListener.listener

Definition at line 15 of file messaging_listen.py.

◆ selector

python.messaging_listen.ATLASDQMListener.selector

Definition at line 17 of file messaging_listen.py.


The documentation for this class was generated from the following file:
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
PyAthena::repr
std::string repr(PyObject *o)
returns the string representation of a python object equivalent of calling repr(o) in python
Definition: PyAthenaUtils.cxx:106
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28