Hi Esteban, > On 29 Jun 2021, at 04:55, Esteban Maringolo <emaring...@gmail.com> wrote: > > Hi, > > I'm rearchitecting a web app to perform updates only when necessary > (instead of computing them all the time) on each request, I can have a > global announcer and subscribers to know when to update within an > image, but is there a way to have something like that but for > inter-image coordination? > > I'd only need to communicate the id and the class name (or a similar > identifier), so on other images they'll update accordingly, and if > there is an update in one image, it will notify the other images. The > common data is on the database, so this is just to avoid re-reading a > lot of things. > > Is a message queue a good fit for this? Pub/Sub? > What is available in Pharo that works without having to set up a lot of > things? > > Thanks! > > Esteban A. Maringolo
RabbitMQ (for which there is the STOMP client 'STAMP' https://github.com/svenvc/stamp) is one option, but it is a bit more complex. I guess Redis would work too (https://medium.com/concerning-pharo/quick-write-me-a-redis-client-5fbe4ddfb13d). More recently I have been using MQTT (with the client https://github.com/svenvc/mqtt) which is much simpler. You post a message on a topic and have one or more listeners see it. You can even arrange for the broker to keep the messages you miss (within a reasonable window) - which is very nice for all kinds of reasons (especially operational). I have a system in production that uses this mechanism to coordinate different images (and handle ingress of data) for more than a year now. Sven