Skip to content

Commit

Permalink
Merge pull request #59 from swhitty/isListening
Browse files Browse the repository at this point in the history
isListening public API
  • Loading branch information
swhitty committed Jun 8, 2023
2 parents 4f7e628 + 9b6b199 commit 7cfff2f
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 7cfff2f

Please sign in to comment.