-
Notifications
You must be signed in to change notification settings - Fork 62
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
Convert SWIMActorShell to distributed actor #977
Conversation
Sources/DistributedActors/Cluster/SWIM/Protobuf/SWIM+Serialization.swift
Outdated
Show resolved
Hide resolved
Sources/DistributedActors/Cluster/SWIM/ClusterMembership+Converters.swift
Outdated
Show resolved
Hide resolved
do { | ||
let response = try await target.ping(payload: payload, from: self, timeout: timeout, sequenceNumber: sequenceNumber) | ||
self.metrics.shell.pingResponseTime.recordInterval(since: pingSentAt) | ||
return self.handlePingResponse( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ActorRef
implementation relies on multiple layers of ask
and tell
to get PingResponse
back to the origin
. The key difference in the DA implementation is that we eliminate the "hops", and the response returned by sendPing
is the one we propagate back to origin
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's very cool actually, great example how request/response focused API of DA makes such patterns simpler :)
Hmmm async await makes things quite tough here :- |
Tests/DistributedActorsTests/Cluster/SWIM/Protobuf/SWIM+SerializationTests.swift
Outdated
Show resolved
Hide resolved
Changed Samples to use Swift 5.7 instead of main. @swift-server-bot test this please |
Tests/DistributedActorsTests/Cluster/SWIM/SWIMActorShellClusteredTests.swift
Show resolved
Hide resolved
This PR is ready for review. Note that besides |
Wohoo! Going to have a look. |
Validate against |
Okey let's keep progressing; I'll focus on tests and hardening for a while now. |
Resolves #973
Haven't worked on tests yet