parameters: (self, event, sentArgs=[], taskChain=None)
docstring: Send this event, optionally passing in arguments.
  
          Args:
              event (str): The name of the event.
              sentArgs (list): A list of arguments to be passed along to the
                  handlers listening to this event.
              taskChain (str, optional): If not None, the name of the task chain
                  which should receive the event.  If None, then the event is
                  handled immediately. Setting a non-None taskChain will defer
                  the event (possibly till next frame or even later) and create a
                  new, temporary task within the named taskChain, but this is the
                  only way to send an event across threads.
docstring_summary: Send this event, optionally passing in arguments.
docstring_tokens: Send this event optionally passing in arguments .
function: def send(self, event, sentArgs=[], taskChain=None):
          """
          Send this event, optionally passing in arguments.
  
          Args:
              event (str): The name of the event.
              sentArgs (list): A list of arguments to be passed along to the
                  handlers listening to this event.
              taskChain (str, optional): If not None, the name of the task chain
                  which should receive the event.  If None, then the event is
                  handled immediately. Setting a non-None taskChain will defer
                  the event (possibly till next frame or even later) and create a
                  new, temporary task within the named taskChain, but this is the
                  only way to send an event across threads.
          """
          if Messenger.notify.getDebug() and not self.quieting.get(event):
              assert Messenger.notify.debug(
                  'sent event: %s sentArgs = %s, taskChain = %s' % (
                  event, sentArgs, taskChain))
  
          self.lock.acquire()
          try:
              foundWatch = 0
              if __debug__:
                  if self.__isWatching:
                      for i in self.__watching:
                          if str(event).find(i) >= 0:
                              foundWatch = 1
                              break
              acceptorDict = self.__callbacks.get(event)
              if not acceptorDict:
                  if __debug__:
                      if foundWatch:
                          print("Messenger: \"%s\" was sent, but no function in Python listened."%(event,))
                  return
  
              if taskChain:
                  # Queue the event onto the indicated task chain.
                  from direct.task.TaskManagerGlobal import taskMgr
                  queue = self._eventQueuesByTaskChain.setdefault(taskChain, [])
                  queue.append((acceptorDict, event, sentArgs, foundWatch))
                  if len(queue) == 1:
                      # If this is the first (only) item on the queue,
                      # spawn the task to empty it.
                      taskMgr.add(self.__taskChainDispatch, name = 'Messenger-%s' % (taskChain),
                                  extraArgs = [taskChain], taskChain = taskChain,
                                  appendTask = True)
              else:
                  # Handle the event immediately.
                  self.__dispatch(acceptorDict, event, sentArgs, foundWatch)
          finally:
              self.lock.release()
function_tokens: def send ( self , event , sentArgs = [ ] , taskChain = None ) : if Messenger . notify . getDebug ( ) and not self . quieting . get ( event ) : assert Messenger . notify . debug ( 'sent event: %s sentArgs = %s, taskChain = %s' % ( event , sentArgs , taskChain ) ) self . lock . acquire ( ) try : foundWatch = 0 if __debug__ : if self . __isWatching : for i in self . __watching : if str ( event ) . find ( i ) >= 0 : foundWatch = 1 break acceptorDict = self . __callbacks . get ( event ) if not acceptorDict : if __debug__ : if foundWatch : print ( "Messenger: \"%s\" was sent, but no function in Python listened." % ( event , ) ) return if taskChain : # Queue the event onto the indicated task chain. from direct . task . TaskManagerGlobal import taskMgr queue = self . _eventQueuesByTaskChain . setdefault ( taskChain , [ ] ) queue . append ( ( acceptorDict , event , sentArgs , foundWatch ) ) if len ( queue ) == 1 : # If this is the first (only) item on the queue, # spawn the task to empty it. taskMgr . add ( self . __taskChainDispatch , name = 'Messenger-%s' % ( taskChain ) , extraArgs = [ taskChain ] , taskChain = taskChain , appendTask = True ) else : # Handle the event immediately. self . __dispatch ( acceptorDict , event , sentArgs , foundWatch ) finally : self . lock . release ( )