[LibEventSourcing] Internal changes to sync module
SamMousa opened this issue ยท 0 comments
I'm reworking some internal APIs and have a few questions about how much you would like to expose to CLM.
The internal reworks are not the goal of this discussion, but whether I expose these to CLM via the LedgerFactory
is.
Sync module moves away from authorizationHandler
and registerReceiveHandler
, instead it now exposes handleMessage(message: table, sender: string, trusted: bool)
.
Approach one:
I can fully hide this in the factory; by calling the callback on every message I received after registering via registerReceiveHandler
.
Approach two:
LedgerFactory.createLedger
changes signature and removesregisterReceiveHandler
.- The resulting ledger object gets a new function
handleMessage(message: table, sender: string, trusted: bool)
that CLM calls after receiving a message and deserializing it.
Which do you prefer?