Open Wanber opened 6 years ago
I recommend using a redis alternative for that use case.
I was actually thinking about this earlier - on a high level you could open a file on the master and have a queue of operations manage the cache, writing to the disk (persistence?) in tandem to updating the workers when change happens. It's naive but all the threads can share the same cache that way.
Singleton cannot solve problem. Interprocess communication can solve with outer solution like memcached.
I have an api gateway running in cluster mode (4), using this lib to cache requests, is there any way to share an instance of lib between the 4 processes?