I was looking at the wasabi framework, and noticed some interesting usage of extension functions:
val handlerExtension : RouteHandler.() -> Unit = handlerval routeHandler = RouteHandler(request!!, response)routeHandler.handlerExtension()
This appears to assign a function to RouteHandler, and then calls the function with a context of a new RouteHandler. Is this thread safe? If two requests are happening at the same time, wouldn't it be possible for this extension to get changed out from under the object? Perhaps I'm just a little confused as to how this is supposed to work.