Skip to main content
2 of 4
edited title; edited title; edited title
Pepster
  • 299
  • 1
  • 10

How to notify a client when data in the embedded view is updated

I'm investigating how we can notify UI/async clients (websocket) about an update which happened in an embedded view.

Let me elaborate...

We currently have a newsfeed where NewsItem is an aggregate root which acts as a wrapper for news about other aggregates. News is extracted asynchronously from domain events of several aggregates. For example BlogPost. The NewsItem contains a type to identify where the news is about (for example NewPost), a timestamp and also the target user ID. There is a newsfeed view-service which combines the items with the real contents of the wrapped aggregate in order to serve the items as a JSON feed in a paginatable fashion. NewsItemViews about a BlogPost also contain the number of comments.

Now what should I do when another comments is posted to the BlogPost? Or the contents of a BlogPost is edited?

We already have a websocket-based callback system to update the UI of a registered target user.

How should I design the newsfeed to be updated when contents of an item view is changing?

Pepster
  • 299
  • 1
  • 10