2

I'm in a project where I need to create a notification system. It's for a website created with the Pyramid framework that runs on the AWS infrastructure (I think the server is apache or paste, not sure).

When a user follows something, all friends should instantly get a notification that states "X is now following Y". Therefore, I need a WebSocket server (maybe node.js or socket.io). If I do so I will have two servers running on the same EC2 instance (the web server and the socket server), but how can I pass the events/notifications from the web server to the socket server?

I guess there should be something in the middle, right? Something that AWS can offer me. Or is there a way to feed the socket server directly?

What would be a good approach for this situation?

A derivated question is: where is the best place to get the friend list that will recieve the notification? Should it be the web server or socket server?

4

1 回答 1

0

您需要在您的 2 个服务器前面有一个代理,它将根据 URL 或其他一些请求参数将请求委托给您的 Pyramid 应用程序或 node.js。

另一种选择是在 gevent 中运行 Pyramid 并利用gevent_socketio在同一个应用程序中完成所有工作。

于 2012-04-27T15:07:39.657 回答