Is your feature request related to a problem? Please describe.
I've been trying to create a reactive listener based on per-session roots notification and found it impossible or wired.
onConnect {
sessions.forEach { (_, session) ->
session.setNotificationHandler<RootsListChangedNotification>(Method.Defined.NotificationsRootsListChanged) {
scope.launch {
session.listRoots()
// do Something with roots per session
}
CompletableDeferred()
}
}
}
I have to reset notifications for all sessions on each new session to properly get the per-session info.
Describe the solution you'd like
onConnect { session : ServerSession ->
// do something with session
}
or
server.setNotificationHandler<RootsListChangedNotification>(Method.Defined.NotificationsRootsListChanged) {session : ServerSession ->
// do something with session
}
or both.
Other infos
I suspect that the no-session-arg style onConnect and other callbacks are the legacy of the old new server per transport architecture.
Is your feature request related to a problem? Please describe.
I've been trying to create a reactive listener based on per-session
rootsnotification and found it impossible or wired.onConnect { sessions.forEach { (_, session) -> session.setNotificationHandler<RootsListChangedNotification>(Method.Defined.NotificationsRootsListChanged) { scope.launch { session.listRoots() // do Something with roots per session } CompletableDeferred() } } }I have to reset notifications for all sessions on each new session to properly get the per-session info.
Describe the solution you'd like
onConnect { session : ServerSession -> // do something with session }or
or both.
Other infos
I suspect that the no-session-arg style
onConnectand other callbacks are the legacy of the oldnew server per transportarchitecture.