|  | @@ -38,11 +38,14 @@ class EventDispatcher(object):
 | 
											
												
													
														|  |      def __init__(self, connection, hostname=None, enabled=True,
 |  |      def __init__(self, connection, hostname=None, enabled=True,
 | 
											
												
													
														|  |              publisher=None):
 |  |              publisher=None):
 | 
											
												
													
														|  |          self.connection = connection
 |  |          self.connection = connection
 | 
											
												
													
														|  | -        self.publisher = publisher or EventPublisher(self.connection)
 |  | 
 | 
											
												
													
														|  |          self.hostname = hostname or socket.gethostname()
 |  |          self.hostname = hostname or socket.gethostname()
 | 
											
												
													
														|  |          self.enabled = enabled
 |  |          self.enabled = enabled
 | 
											
												
													
														|  |          self._lock = threading.Lock()
 |  |          self._lock = threading.Lock()
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +        self.publisher = None
 | 
											
												
													
														|  | 
 |  | +        if self.enabled:
 | 
											
												
													
														|  | 
 |  | +            self.publisher = publisher or EventPublisher(self.connection)
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |      def send(self, type, **fields):
 |  |      def send(self, type, **fields):
 | 
											
												
													
														|  |          """Send event.
 |  |          """Send event.
 | 
											
												
													
														|  |  
 |  |  
 |