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

Docs: More docs on cluster joining, and how to do it. #1086

Open
ktoso opened this issue Nov 7, 2022 · 1 comment
Open

Docs: More docs on cluster joining, and how to do it. #1086

ktoso opened this issue Nov 7, 2022 · 1 comment

Comments

@ktoso
Copy link
Member

ktoso commented Nov 7, 2022

Maybe we can polish up and add some more methods...?

join is, on purpose, not async, to not cause a pain by having to wait for joining.

But may be it should be, if this fire-and-forget is causing people confusion?

We have already await system.cluster.joined(), and await system.cluster.waitFor(node, .up) and other conveniences, but perhaps the not async join is confusing people?

@ktoso
Copy link
Member Author

ktoso commented Nov 7, 2022

Making all join/leave etc async IMHO sucks since often you don't really care and it'd cause

Task { await ... }
Task { await ... }
Task { await ... }
Task { await ... }

walls of doom heh...

  • I also don't like if we did join() async and join() since then in async context you are FORCED to await...
  • Another ugly option is to join() and joinWait() but that also is ugly...
  • the public func waitFor(_ nodes: some Collection<Cluster.Node>, _ status: Cluster.MemberStatus, within: Duration) async throws APIs do what Peter asked for here but they don't initiate a join

We have convenience "waiters" await system.cluster.joined or rather the renamed await system.cluster.up() but they also don't initiate.

Perhaps we just need more documentation here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant