withCurrentThreadAsEventLoop(_:)

Convert the calling thread into an EventLoop.

MultiThreadedEventLoopGroup.swift:458
static func withCurrentThreadAsEventLoop(_ callback: @escaping (any EventLoop) -> Void)

Parameters

callback

Called on the EventLoop that the calling thread was converted to, providing you the EventLoop reference. Just like usually on the EventLoop, do not block in callback.

This function will not return until the EventLoop has stopped. You can initiate stopping the EventLoop by calling eventLoop.shutdownGracefully which will eventually make this function return.