def __init__(self, settings = None, handlers = None):
if settings is None:<EOL><INDENT>settings = XMPPSettings()<EOL><DEDENT>self.queue = settings["<STR_LIT>"]<EOL>self._handler_map = defaultdict(list)<EOL>if handlers:<EOL><INDENT>self.handlers = list(handlers)<EOL><DEDENT>else:<EOL><INDENT>self.handlers = []<EOL><DEDENT>self._update_handlers()<EOL>self.lock = threading.RLock()<EOL>
Initialize the event dispatcher.

        :Parameters:
            - `settings`: the settings. "event_queue" settings provides the
              event queue object.
            - `handlers`: the initial list of event handler objects.
        :Types:
            - `settings`: `XMPPSettings`
            - `handlers`: iterable of objects