Created
May 11, 2020 04:58
-
-
Save gterzian/19d18f9b628d7bbaf1ece81e7e4a0766 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] | |
struct CustomerId(Uuid); | |
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] | |
struct OrderId(Uuid); | |
/// Messages sent from the "basket" service, | |
/// to the "order" service. | |
enum OrderRequest { | |
/// A customer is attempting to make a new order. | |
NewOrder(CustomerId), | |
/// We're shutting down. | |
ShutDown, | |
} | |
/// The result of making a new order, | |
/// sent by the "order" service, to the "basket" service. | |
struct OrderResult(CustomerId, bool); | |
/// Messages sent from the "order" service, | |
/// to the "payment" service. | |
enum PaymentRequest { | |
/// Attempt a payment for an order. | |
NewOrder(OrderId), | |
/// We're shutting down. | |
ShutDown, | |
} | |
/// The result of making a new payment, | |
/// sent by the "payment" service, to the "order" service. | |
struct PaymentResult(OrderId, bool); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment