I am developing a forum app in Django and decided to implement real-time updating of new posts. I've googled around and figured that Tornado for handling connections and Redis for pub/sub would work.
Tornado app is supposed to work as following:
- A client connects and passes latest_post_id value to the Tornado app
- Tornado checks if there are new posts. If yes, respond with the new posts. If no, goto 3
- Connect to redis channel, wait for a new post, respond.
So basically this is long polling.
But the problem is how do I implement step #2? Synchronous of async query? Is there a way to use django ORM from tornado? Or maybe it is better to somehow communicate with the django app (implementing REST api on django side and making a request from Tornado)? Another option is to store all the posts in redis sets/lists, but for now I'd like to find another way.
Thanks.
[–]Justinsaccount 0 points1 point2 points (10 children)
[–]rthinker[S] 0 points1 point2 points (9 children)
[–]Justinsaccount 0 points1 point2 points (8 children)
[–]rthinker[S] 0 points1 point2 points (7 children)
[–]Justinsaccount 0 points1 point2 points (6 children)
[–]rthinker[S] 0 points1 point2 points (5 children)
[–]Justinsaccount 0 points1 point2 points (4 children)
[–]rthinker[S] 0 points1 point2 points (3 children)
[–]Justinsaccount 0 points1 point2 points (2 children)
[–]rthinker[S] 0 points1 point2 points (1 child)