NOTICK: Fix IRSDemo code to wait for a response when updating day (#6329)

This commit is contained in:
Ryan Fowler 2020-06-10 18:30:00 +01:00 committed by GitHub
parent 58af87c988
commit 48ed9dbc6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,6 +27,7 @@ object UpdateBusinessDayFlow {
override fun call() {
val message = otherPartySession.receive<UpdateBusinessDayMessage>().unwrap { it }
(serviceHub.clock as DemoClock).updateDate(message.date)
otherPartySession.send(true) // Let's Broadcast know we've updated the clock
}
}
@ -64,7 +65,7 @@ object UpdateBusinessDayFlow {
@Suspendable
private fun doNextRecipient(recipient: Party) {
initiateFlow(recipient).send(UpdateBusinessDayMessage(date))
initiateFlow(recipient).sendAndReceive<Boolean>(UpdateBusinessDayMessage(date))
}
}
}