I wonder whether there is a method that I could fire observation (Model observers) on multiple rails servers ? Any help is highly appreciated

有帮助吗?

解决方案

Depends on what you call observation, I assume it's model observers?

The point is each of your servers are isolated, so you can't share data easily without playing with Thread safety and Mutex objects; or shared temporary database table.

An easy way to have a central notification of model activity would be to use a (or a cluster of) redis server. Redis can be monitored by a Rail central process so when any of your server post an event in Redis, you Rail central process is notified right away.

http://redis.io/

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top