Created
April 16, 2021 11:00
-
-
Save aludwiko/3a39c4e1ec9f4a641149a856d1dd28a6 to your computer and use it in GitHub Desktop.
This file contains 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
public class UserService { | |
private Duration askTimeout; | |
public CompletionStage<Result> create(CreateUser createUser) { | |
getUserEntityRef(createUser.userId()).ask(replyTo -> UserCommandEnvelope.of(createUser, replyTo), askTimeout); | |
} | |
public CompletionStage<Result> verify(VerifyUser verifyUser) { | |
getUserEntityRef(verifyUser.userId()).ask(replyTo -> UserCommandEnvelope.of(verifyUser, replyTo), askTimeout); | |
} | |
private EntityRef<UserEntity> getUserEntityRef(String userId) { | |
return ...; //depends on deployment strategy local vs cluster | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment