setNotificationHandler

fun <T : Notification> setNotificationHandler(method: Method, handler: (notification: T) -> Deferred<Unit>)(source)

Registers a handler to invoke when this protocol object receives a notification with the given method.

Note that this will replace any previous notification handler for the same method.