Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public poll functions #173

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sources/WebDriver/Poll.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import struct Dispatch.DispatchTime
/// Calls a closure repeatedly with exponential backoff until it reports success or a timeout elapses.
/// Thrown errors bubble up immediately, returned errors allow retries.
/// - Returns: The successful value.
internal func poll<Value>(
public func poll<Value>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think providing a poll function is out of scope for swift-webdriver as a library, even if it needs it internally. I'd be curious to see what your use case is though, in case there are functionality gaps to be filled.

timeout: TimeInterval,
initialPeriod: TimeInterval = 0.001,
work: () throws -> Result<Value, Error>) throws -> Value {
Expand Down Expand Up @@ -33,7 +33,7 @@ internal func poll<Value>(

/// Calls a closure repeatedly with exponential backoff until it reports success or a timeout elapses.
/// - Returns: Whether the closure reported success within the expected time.
internal func poll(
public func poll(
timeout: TimeInterval,
initialPeriod: TimeInterval = 0.001,
work: () throws -> Bool) throws -> Bool {
Expand Down