Closed isaacsanders closed 2 years ago
The main reason is that we don't want to allow custom code to run from connection processes, so a subscription style seems more appropriate. You can always emit telemetry from a listener though!
Also note that disconnected is not guaranteed to be invoked, I pushed some docs making it clearer. So you need a subscription+monitor depending on what you want to achieve with telemetry.
Right now there is system that couples the disconnects and connects to the specific implementation of connection listeners, but I think that the current approach for this soft of "observer" pattern would be more often done as a telemetry event.