Skip to content

Conversation

@yim-lee
Copy link
Member

@yim-lee yim-lee commented Jun 17, 2022

Change ping and pingRequest to async and remove onResponse callback parameter.

This change requires Swift 5.5.

DO NOT MERGE for there are broken tests

@ktoso ktoso marked this pull request as draft June 17, 2022 09:16
Copy link
Member Author

@yim-lee yim-lee left a comment

Choose a reason for hiding this comment

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

This is ready for review.

@yim-lee yim-lee marked this pull request as ready for review June 19, 2022 00:57
@yim-lee yim-lee changed the title [DNM][WIP] Convert APIs to async Convert APIs to async Jun 19, 2022
@ktoso
Copy link
Member

ktoso commented Jul 29, 2022

Looking in depth now, along with apple/swift-distributed-actors#977

I think by landing both updates at the same time we can bump APIs and make them all async native etc 👍

@ktoso ktoso self-requested a review July 29, 2022 08:03
@ktoso
Copy link
Member

ktoso commented Aug 2, 2022

Removed the embedded tests for now, way too much pain than they're worth -- until we get an async/await aware embedded NIO testing story (soon).

Ticket here: Bring back embedded SWIMNIO tests, which are had without async-aware "Embedded" infra #86


/// Create a new member.
public init(peer: SWIMPeer, status: SWIM.Status, protocolPeriod: UInt64, suspicionStartedAt: DispatchTime? = nil) {
public init(peer: Peer, status: SWIM.Status, protocolPeriod: UInt64, suspicionStartedAt: DispatchTime? = nil) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Do we want to change suspicionStartedAt to an Instant type instead?

Copy link
Member

Choose a reason for hiding this comment

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

I seem to remember instant isn't great for this but maybe I'm wrong...?

Copy link
Member

Choose a reason for hiding this comment

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

I ticketified #87

}

/// Represents number of nanoseconds within given time unit
enum PrettyTimeUnit: Int64 {
Copy link
Member Author

Choose a reason for hiding this comment

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

Used?

Copy link
Member

Choose a reason for hiding this comment

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

removed, thanks!

case nanoseconds = 1
// @formatter:on

var abbreviated: String {
Copy link
Member Author

Choose a reason for hiding this comment

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

Used?

Copy link
Member

Choose a reason for hiding this comment

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

seems not, removing --


public var description: String {
"SWIMNIOTimeoutError(timeout: \(self.timeout.prettyDescription), \(self.message))"
"SWIMNIOTimeoutError(timeout: \(self.timeout), \(self.message))"
Copy link
Member Author

Choose a reason for hiding this comment

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

We don't want to keep prettyDescription?

Copy link
Member

Choose a reason for hiding this comment

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

Just because I didn't want to make a public extension with the pretty stuff on the Swift types, figured we shouldn't add public API on those

Copy link
Member

Choose a reason for hiding this comment

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

Sorry my bad, should be fine since it is internal here

@ktoso ktoso merged commit 68b2da6 into apple:main Aug 3, 2022
@yim-lee yim-lee deleted the async-await branch August 3, 2022 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants