Open ShapeOfMatter opened 4 months ago
should contribute toward #20.
Would whatever is in https://github.com/ShapeOfMatter/HasChorPlus/blob/main/src/Choreography/Network/Local.hs already store the messages sent by different parties?
-- | Each location is associated with a message buffer which stores messages sent
-- from other locations.
type MsgBuf = HashMap LocTm (Chan String)
newtype LocalConfig = LocalConfig
{ locToBuf :: HashMap LocTm MsgBuf
}
No, I don't think so. It's using Chan
s, which "store" the messages only until the relevant process consumes them.
I'm sure we could shim this to do what we want, and I'm not opposed to that, but it'd be smelly. We shouldn't need concurrency for this; something that works like Choreography.Choreo.runChoreo
, but with the side-effect of accumulating everyone's views as state, would seem like the "right" way to do it.
Ah ok thanks for the clarification. I think it should be fairly easy to port this over to state.
In various contexts, including some of our (planned) examples, we care about the transcripts (views) of various parties. We should write handlers to gather them explicitly.