fun onClose(callback: () -> Unit): Ref
Register a close callback
Note: the callback might be called on another thread
callback - A callback called when the channel is closed
callback
Return A ref that can be used with Channel.off