diff options
author | Kali Kaneko <kali@leap.se> | 2015-09-14 23:19:58 -0400 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2015-09-16 02:00:27 +0200 |
commit | 0a03c0a014b1874114eabb855705ca79f09d1982 (patch) | |
tree | ea10d37ba6b21a91636daf96163c79f62ac73179 /src/leap/mail/smtp/__init__.py | |
parent | cf7906eda74ad73d026f1a2a29b3581d72abb473 (diff) |
[feat] use async events api
in this way, we're using twisted reactor instead of having another
thread with zmq's own copy of tornado ioloop.
Resolves: #7274
Diffstat (limited to 'src/leap/mail/smtp/__init__.py')
-rw-r--r-- | src/leap/mail/smtp/__init__.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/leap/mail/smtp/__init__.py b/src/leap/mail/smtp/__init__.py index 2ff14d7..a77a414 100644 --- a/src/leap/mail/smtp/__init__.py +++ b/src/leap/mail/smtp/__init__.py @@ -24,7 +24,7 @@ from twisted.internet import reactor from twisted.internet.error import CannotListenError from leap.mail.outgoing.service import OutgoingMail -from leap.common.events import emit, catalog +from leap.common.events import emit_async, catalog from leap.mail.smtp.gateway import SMTPFactory logger = logging.getLogger(__name__) @@ -65,12 +65,12 @@ def setup_smtp_gateway(port, userid, keymanager, smtp_host, smtp_port, factory = SMTPFactory(userid, keymanager, encrypted_only, outgoing_mail) try: tport = reactor.listenTCP(port, factory, interface="localhost") - emit(catalog.SMTP_SERVICE_STARTED, str(port)) + emit_async(catalog.SMTP_SERVICE_STARTED, str(port)) return factory, tport except CannotListenError: logger.error("STMP Service failed to start: " "cannot listen in port %s" % port) - emit(catalog.SMTP_SERVICE_FAILED_TO_START, str(port)) + emit_async(catalog.SMTP_SERVICE_FAILED_TO_START, str(port)) except Exception as exc: logger.error("Unhandled error while launching smtp gateway service") logger.exception(exc) |