Open dmaretskyi opened 4 years ago
Tracing async event flows.
From a discussion between Rich/Thomas
PartyProcessor
becomes a Model).GreetingResponder
, DeviceManager
)Simplified form of sorting K sorted arrays.
class StreamEvaluator {
processMessage(feedKey, message) {
// Check if feedKey has been admitted to an existing party.
const party = getParty(feedKey);
// If not, check if this is a genesis message and if so, create the Party (which then admits this feedKey).
if (!party) {
return processGenesis(feedKey, message);
}
if (isPartyMessage(message)) {
return party.processMessage(feedKey, message);
}
// Get existing item.
// NOTE: could delegate following logic to party-specific ItemStreamEvaluator (Index?)
const { itemKey } = message;
const model = getModel(itemKey);
if (!model) {
// Create item if valid, otherwise skip.
return processItemGenesis(feedKey, message);
}
return model.processMessage(feedKey, message);
}
}
credentials.Party
to PartyState
(party-state
)this._partyManager.identityManager.deviceManager.keyChain
(with respect to encapsulation).UML diagram sources: https://github.com/dxos/halo/tree/master/packages/party-manager/docs
Messages
Class diagram