But how to use them? I can't find some demo code. ...
# ktor
f
But how to use them? I can't find some demo code. Somebody give a hint ? Thanks.
1
📝 1
d
Sorry. Misread it. As Johannes suggested, there is a sample in the CallLogging implementation for using events. How to use them are there. Basically there is a
monitor
instance that you can grab from:
application.environment.monitor
And then you do things like:
monitor.subscribe
and
monitor.unsubscribe
with the event definitions and handlers.
I have added a new page explaining this: https://ktor.io/advanced/events.html