龙卷风无阻塞SMTP客户端 [英] Tornado non-blocking SMTP client
问题描述
有没有人遇到过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客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!