xtra icon indicating copy to clipboard operation
xtra copied to clipboard

Differentiate single and broadcast message on type-system level

Open thomaseizinger opened this issue 3 years ago • 0 comments

Prior to this patch-set, we had constructs like MessageType and SentMessage. These were used to write code that is generic over a particular message type. In reality however, we don't actually need to differentiate between these cases because the codepaths for each type are statically known in all cases.

Unfortunately, introducing an actual split introduced a bit more code (net ~ 70 lines) but in exchange, we remove a few unreachable error clauses and make it overall easier to follow the dataflow through xtra's channel implementation.

I'd recommend a patch-by-patch review. They all build and run without errors which should make it easier to understand how this change builds up.

thomaseizinger avatar Aug 08 '22 12:08 thomaseizinger