问题描述
我正在寻找python异步SMTP客户端连接它与Torando IoLoop。我发现只是简单的含义(),但它是一个阻止解决方案,所以它可能会带来性能问题。有没有人遇到过Tornado的非阻塞SMTP客户端?一些代码片段也是非常有用的。
我根据线程和队列编写了解决方案。每龙卷风过程一线。这个线程是一个工作者,从队列获取电子邮件,然后通过SMTP发送。通过将龙卷风应用程序添加到队列中来发送电子邮件。简单易用。
以下是GitHub上的示例代码:
I'am looking for python async SMTP client to connect it with Torando IoLoop. I found only simple implmementation (http://tornadogists.org/907491/) but it's a blocking solution so it might bring performance issues.
Does anyone encountered non blocking SMTP client for Tornado? Some code snippet would be also very useful.
I wrote solution based on threads and queue. One thread per tornado process. This thread is a worker, gets email from queue and then send it via SMTP. You send emails from tornado application by adding it to queue. Simple and easy.
Here is sample code on GitHub: link
这篇关于龙卷风无阻塞SMTP客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!