Frage

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

War es hilfreich?

Lösung

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/

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top