Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

🚩 add the ability to store and watch synced data #85

Closed
wants to merge 4 commits into from

Conversation

jpwilliams
Copy link
Owner

A really interesting little idea.

This adds the ability to use a new remit.watch command. It functions similarly to a listener, but is intended for a block of JSON synced between multiple processes.

// create the watcher
const watcher = remit
  .watch('my.synced.data')
  .handler(({ data }) => {
    console.log('got new data:', data)
  })

watcher.start()

// access the current data set
console.log('current data is:', watcher.state)

Multiple processes accessing the same my.synced.data there will all receive the same JSON block. To change it, any of the processes can send an emission to my.synced.data and all of the watchers will receive the update.

Testing it out in a tiny little environment with servers spinning up and down. It's a super-interesting little idea, though not sure how viable/useful it is in the real world.

@jpwilliams jpwilliams added this to In Progress in Test Project Jul 6, 2018
@jpwilliams
Copy link
Owner Author

This ran in to some fundamental problems and won't be possible until a few RabbitMQ versions in to the future.

@jpwilliams jpwilliams closed this Mar 25, 2019
Test Project automation moved this from In Progress to Done Mar 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Test Project
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

1 participant