We model those operations as commands to be sent to the auction actor: Scala case class Bid(bidder: String, offer: MoneyAmount, timestamp: Instant, originDc: String)Ĭase class OfferBid(bidder: String, offer: MoneyAmount) extends AuctionCommandĬase object Finish extends AuctionCommand // A timer needs to schedule this event at each replicaĬase object GetHighestBid extends AuctionCommandĬase object IsClosed extends AuctionCommand An auction is represented by one replicated actor. In the end, you will end up with a solution based on a custom CRDT. In this example we want to show that real-world applications can be implemented by designing events in a way that they don’t conflict. Having to use CRDTs for replication might seem like a severe constraint because the set of predefined CRDTs is quite limited.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
May 2023
Categories |