parameters: (self, event, _)
docstring: Process session event
docstring_summary: Process session event
docstring_tokens: Process session event
function: def processEvent(self, event, _):
          """Process session event"""
  
          eventType = event.eventType()
  
          for msg in event:
              messageType = msg.messageType()
              cid = msg.correlationId()
              myCorrelation = cid.value()
              if messageType == Names.REQUEST_TEMPLATE_AVAILABLE:
                  print("Request template is successfully created for topic"
                        f" {myCorrelation}")
                  print(msg)
  
                  with self._lock:
                      # Decrease template count
                      self._templateCount -= 1
                      self.d_templateBatchingCondition.notify_all()
  
                      # Decrease response count
                      self._responseCount -= 1
                      self._responseCondition.notify_all()
              elif messageType == Names.REQUEST_TEMPLATE_TERMINATED:
                  # Will also receive a 'RequestFailure' message preceding
                  # 'RequestTemplateTerminated' for every pending request.
                  print(f"Request template terminated for topic {myCorrelation}")
                  print(msg)
  
                  with self._lock:
                      # Remove the template
                      del self._snapshots[myCorrelation]
  
                      # Decrease template count
                      self._templateCount -= 1
                      self.d_templateBatchingCondition.notify_all()
  
                      # Decrease response count
                      self._responseCount -= 1
                      self._responseCondition.notify_all()
              elif eventType == blpapi.Event.PARTIAL_RESPONSE:
                  print(f"Received partial response for topic {myCorrelation}")
                  print(msg)
              elif eventType == blpapi.Event.RESPONSE:
                  print(f"Received response for topic {myCorrelation}")
                  print(msg)
  
                  with self._lock:
                      self._responseCount -= 1
                      self._responseCondition.notify_all()
              elif msg.messageType() == Names.SESSION_TERMINATED:
                  with self._lock:
                      self._running = False
                      self.d_templateBatchingCondition.notify_all()
                      self._responseCondition.notify_all()
function_tokens: def processEvent ( self , event , _ ) : eventType = event . eventType ( ) for msg in event : messageType = msg . messageType ( ) cid = msg . correlationId ( ) myCorrelation = cid . value ( ) if messageType == Names . REQUEST_TEMPLATE_AVAILABLE : print ( "Request template is successfully created for topic" f" {myCorrelation}" ) print ( msg ) with self . _lock : # Decrease template count self . _templateCount -= 1 self . d_templateBatchingCondition . notify_all ( ) # Decrease response count self . _responseCount -= 1 self . _responseCondition . notify_all ( ) elif messageType == Names . REQUEST_TEMPLATE_TERMINATED : # Will also receive a 'RequestFailure' message preceding # 'RequestTemplateTerminated' for every pending request. print ( f"Request template terminated for topic {myCorrelation}" ) print ( msg ) with self . _lock : # Remove the template del self . _snapshots [ myCorrelation ] # Decrease template count self . _templateCount -= 1 self . d_templateBatchingCondition . notify_all ( ) # Decrease response count self . _responseCount -= 1 self . _responseCondition . notify_all ( ) elif eventType == blpapi . Event . PARTIAL_RESPONSE : print ( f"Received partial response for topic {myCorrelation}" ) print ( msg ) elif eventType == blpapi . Event . RESPONSE : print ( f"Received response for topic {myCorrelation}" ) print ( msg ) with self . _lock : self . _responseCount -= 1 self . _responseCondition . notify_all ( ) elif msg . messageType ( ) == Names . SESSION_TERMINATED : with self . _lock : self . _running = False self . d_templateBatchingCondition . notify_all ( ) self . _responseCondition . notify_all ( )