live notification if data changed

I am wondering if the following is possible with Yii2

User A is updating/viewing book A

User B is updating and push changes the book A title.

I want to display a popup to User A (whether he is viewing or updating Book A) that Book A has been updated. Please refresh.

If you want to do this in realtime, I think you should use, but keep track of users that are updating a model from a view require a bit of work;

Instead, you could make this check after submit, creating a field in the database named "hash" (for example) and comparing it with that has been passed from form.

thanks, it would work in my case