简体   繁体   English

Django XMPP连接池

[英]Django XMPP Connection pooling

How can i pool a connection to XMPP server in django so that it is available across multiple requests. 如何在django中集合到XMPP服务器的连接,以便它可以跨多个请求使用。 I don't want to connect and authenticate on every request which makes it a bit slow. 我不希望在每个请求上进行连接和验证,这使得它有点慢。 Is this possible? 这可能吗?

EDIT: 编辑:

I am using xmpppy python xmpp library 我正在使用xmpppy python xmpp库

As xmpppy has its own main loop I suggest to use it in a separate thread or even start separately. 由于xmpppy有自己的主循环,我建议在单独的线程中使用它,甚至单独启动。 Actually you do have two separate applications: website and xmpp-client and it is normal to run them separately. 实际上你有两个独立的应用程序:网站和xmpp-client,单独运行它们是正常的。

In this case you may use different ways to communicate between your applications: pipes between threads and/or processes, tcp or unix socket, file queue, different amqp silutions, any persistent storage, even d-bus, etc. But that is a subject for another question I think. 在这种情况下,您可以使用不同的方式在您的应用程序之间进行通信:线程和/或进程之间的管道,tcp或unix套接字,文件队列,不同的amqp silutions,任何持久存储,甚至是d-bus等。但这是一个主题我认为另一个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM