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

Add expect initalization method #5

Open
volfco opened this issue Mar 28, 2021 · 0 comments
Open

Add expect initalization method #5

volfco opened this issue Mar 28, 2021 · 0 comments

Comments

@volfco
Copy link
Owner

volfco commented Mar 28, 2021

There should be an expect method added to ZkStruct that blocks until data appears in the assumed location. Like this:

zkstate::ZkState::expect(
    zk.clone(), 
    "/testing"
).unwrap()

Expect should block until /testing/payload is populated by someone else. This is useful when you're creating a ZkState object from a ZooKeeper Watcher firing, and you get a notification that a node is appearing and you want to create a local copy of it. Using new requires a bogus struct that might be visible to listeners locally before this library populates it.

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

No branches or pull requests

1 participant