is `this::method` actually leaking when called in ...
# announcements
d
is
this::method
actually leaking when called in
init
or
constructor
blocks?
k
What do you mean exactly? Can you show us some code?
d
Copy code
addMessageHandler(GatewayHello::class.java, this::onHello)
        addMessageHandler(GatewayAck::class.java, this::onGatewayAck)
        addMessageHandler(GatewayInvalid::class.java, this::onGatewayInvalid)
        addMessageHandler(GatewayReconnect::class.java, this::onGatewayReconnect)
Basically, this snippet implies that when an object of that particular type is passed to coroutine channel (they're all children of
Request
), that particular callback must be called. Note that this is only called in
init
block.