开发者

Using node.js to use streaming web api's with django

I am trying to write a django application that will use twitter's streaming api. Obviously it can not be done as it is with django since call to twitter will be blocking . Thus i would need to make an asynchronous call to twitter. This led me to think this is a nice opportunity to try out node.js . From what i hear about node.js it seems ideal for making such asynchronous calls. Can someone tell me how i can integrate django and node.js such that all the blocking web api calls can be don开发者_运维问答e using node and all the other aspects of web development can be handled using django.


Look at permanent unix domain sockets connection to proxy content from node.js to python or whatever you want.


I bet the best solution is to use the mediation of a MQ such as RabbitMQ or ZeroMQ to send messages between the two processes. They seem to be simple to use and very popular.

(Said that, I add that it is an interesting challenge but I would hate to deal with such a complex system. It is all fun and games until somebody loses an eye - and cannot find it out because it is lost in a tightly coupled, ad hoc-driven bunch of code written in two languages using two very different paradigms. If you are planning to create real-life production code, I do not believe such architecture would be a good idea - althoug it is a great idea as an exercise.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜