1 min readSep 29, 2019
I have a question about the BroadCastChannel
: isn’t that a resource that you must manage, i.e. close the channel after it’s no longer needed? In your current example you’d never close it, i.e. you’d leak some potential hot resource. How do you suggest managing it?
I think the repo should either be a closable resource, or it should not construct the channel itself, but get it (e.g. through its constructor or dependency injection).
Here an example: https://gist.github.com/erikhuizinga/6d3f555200efdad38a04064580938b71