Add waitUntilComplete() method to Server (#26)

* Add waitUntilComplete() method to Server

* Update Sources/MCP/Server/Server.swift

Co-authored-by: Mattt <mattt@me.com>

---------

Co-authored-by: Mattt <mattt@me.com>
This commit is contained in:
Adam Wulf 2025-03-29 06:26:16 -05:00 • committed by GitHub
commit 97b756c0f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -221,6 +221,7 @@ public actor Server {
await logger?.error(
"Fatal error in message handling loop", metadata: ["error": "\(error)"])
}
await logger?.info("Server finished", metadata: [:])
}
}
@ -234,6 +235,10 @@ public actor Server {
connection = nil
}
public func waitUntilCompleted() async {
await task?.value
}
// MARK: - Registration
/// Register a method handler