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

Blocking takes a u64 For index but ApiResponse returns a string #26

Open
jgould22 opened this issue Apr 24, 2023 · 0 comments
Open

Blocking takes a u64 For index but ApiResponse returns a string #26

jgould22 opened this issue Apr 24, 2023 · 0 comments

Comments

@jgould22
Copy link

I am trying to make some blocking calls against the key value store to keep a watch on a value.

This means I need to make requests with the index Blocking feature set.

I am using the below

https://docs.rs/consulrs/latest/consulrs/api/features/struct.Blocking.html

https://docs.rs/consulrs/latest/consulrs/api/struct.ApiResponse.html

                let mut res = consulrs::kv::read(
                    &consul_client,
                    &key,
                    Some(
                        ReadKeyRequestBuilder::default()
                            .key(&key)
                            .features(
                                consulrs::api::features::Features {
                                    blocking: Some(consulrs::api::features::Blocking {
                                        index:my_index,
                                        wait: Some("500s".to_string()),
                                    }),
                                    ..consulrs::api::features::Features::default()
                                }
                            )
                            .recurse(false),
                    ),
                )
                .await;

Is there an easier way to do this without having to convert the index to a string or u64 in the request response loop.

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