You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to broadcast the events recorded in an Aggregate Root?
Say I have an auction system and an AuctionBidCreated event. I want this to be sent to the frontend via websockets.
I have added ShouldBroadcastNow interface and broadcastOn method to my Event which I am calling with $this->recordThat() in the aggregate. However, the event doesn't seem to be broadcast.
When I try doing broadcast(new AuctionBidCreated) event manually, it is broadcast.
Ideally I don't want to duplicate the code.
Will I have to manually broadcast the event in a reactor?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is it possible to broadcast the events recorded in an Aggregate Root?
Say I have an auction system and an
AuctionBidCreated
event. I want this to be sent to the frontend via websockets.I have added
ShouldBroadcastNow
interface andbroadcastOn
method to my Event which I am calling with$this->recordThat()
in the aggregate. However, the event doesn't seem to be broadcast.When I try doing
broadcast(new AuctionBidCreated)
event manually, it is broadcast.Ideally I don't want to duplicate the code.
Will I have to manually broadcast the event in a reactor?
Beta Was this translation helpful? Give feedback.
All reactions