This set of changes refactors the ChannelManager class (together with a few others around it), so that all threading and synchronisation is removed. Instead, the ChannelManager is now purely logic for handling the various possible updates (e.g. through ProcessOnChain, ProcessOffChain and ProcessLocalMove) and triggering corresponding callbacks (like on-chain transactions or off-chain moves).
All of the actual event loops (for the chain-to-channel feeder or off-chain broadcast receiving) are moved to another level, and synchronisation as well as "wait-for-change" functionality are now in a new class SynchronisedChannelManager.
With this change, the core game-channel logic works without any threading, locks and (in combination with the previous #115) networking. This makes it suitable to be run in other environments, e.g. as wasm in a browser-based frontend.
This set of changes refactors the
ChannelManager
class (together with a few others around it), so that all threading and synchronisation is removed. Instead, theChannelManager
is now purely logic for handling the various possible updates (e.g. throughProcessOnChain
,ProcessOffChain
andProcessLocalMove
) and triggering corresponding callbacks (like on-chain transactions or off-chain moves).All of the actual event loops (for the chain-to-channel feeder or off-chain broadcast receiving) are moved to another level, and synchronisation as well as "wait-for-change" functionality are now in a new class
SynchronisedChannelManager
.With this change, the core game-channel logic works without any threading, locks and (in combination with the previous #115) networking. This makes it suitable to be run in other environments, e.g. as wasm in a browser-based frontend.