Skip to content

Commit

Permalink
isListening public API
Browse files Browse the repository at this point in the history
  • Loading branch information
swhitty committed Jun 8, 2023
1 parent 4f7e628 commit 9b6b199
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions FlyingFox/Sources/HTTPServer+Listening.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import FlyingSocks

extension HTTPServer {

public var isListening: Bool { state != nil }

public func waitUntilListening(timeout: TimeInterval = 5) async throws {
try await withThrowingTimeout(seconds: timeout) {
try await self.doWaitUntilListening()
Expand Down
1 change: 0 additions & 1 deletion FlyingFox/Sources/HTTPServer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ public final actor HTTPServer {
}
}

var isListening: Bool { state != nil }
var waiting: Set<Continuation> = []
private(set) var state: (socket: Socket, task: Task<Void, Error>)? {
didSet { isListeningDidUpdate(from: oldValue != nil ) }
Expand Down

0 comments on commit 9b6b199

Please sign in to comment.