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

clarify z_get_liveliness example #63

Open
milyin opened this issue Dec 8, 2024 · 0 comments
Open

clarify z_get_liveliness example #63

milyin opened this issue Dec 8, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@milyin
Copy link
Contributor

milyin commented Dec 8, 2024

This piece of code

 let receiver = session.liveliness().get(key_expr, {timeout: seconds.of(20)});

  if (!(receiver instanceof Receiver)){
    return // Return in case of callback get query
  }

  let reply = await receiver.receive();

is unclear. The get may return undefined value if callback passed to the options. But in this example this never happens and it makes user wonder why this check is required.

Better to add e.g as Receiver to first let expression

@milyin milyin added the documentation Improvements or additions to documentation label Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: No status
Development

No branches or pull requests

1 participant