https://kotlinlang.org logo
Title
d

dragas

08/16/2017, 10:02 AM
is
this::method
actually leaking when called in
init
or
constructor
blocks?
k

karelpeeters

08/16/2017, 10:46 AM
What do you mean exactly? Can you show us some code?
d

dragas

08/16/2017, 10:48 AM
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.