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:
parent
8dfc9c7875
commit
97b756c0f4
1 changed files with 5 additions and 0 deletions
|
|
@ -221,6 +221,7 @@ public actor Server {
|
||||||
await logger?.error(
|
await logger?.error(
|
||||||
"Fatal error in message handling loop", metadata: ["error": "\(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
|
connection = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public func waitUntilCompleted() async {
|
||||||
|
await task?.value
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: - Registration
|
// MARK: - Registration
|
||||||
|
|
||||||
/// Register a method handler
|
/// Register a method handler
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue