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

Semaphore API #162

Merged
merged 13 commits into from
Jan 23, 2024
Merged

Semaphore API #162

merged 13 commits into from
Jan 23, 2024

Conversation

Shishqa
Copy link
Contributor

@Shishqa Shishqa commented Nov 19, 2023

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Other information

Copy link
Member

@rekby rekby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work!

println!("done");

let mut handles: Vec<JoinHandle<()>> = vec![];
for _ in range(0, 4) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why range instead of for _ in 0..4?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


#[derive(Debug, serde::Serialize)]
#[allow(dead_code)]
pub struct SemaphoreSession {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to move wrappers of grpc messages to grpc_wrapper

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


#[derive(Clone)]
struct MethodControllers {
pub create_semaphore: Arc<RequestController<RawCreateSemaphoreResult>>,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make private

#[allow(dead_code)]
pub struct AcquireOptions {
#[builder(setter(strip_option), default)]
pub data: Option<Vec<u8>>,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make pub or pub(crate) consistent with the rest of the sdk

}

pub fn client(&self) -> CoordinationClient {
unimplemented!()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Single,
Exclusive,
Custom(u64),
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

different methods for different options

Mutex,
Unbounded,
Custom(u64),
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make different methods

_name: String,
_options: WatchOptions,
) -> YdbResult<mpsc::Receiver<SemaphoreDescription>> {
unimplemented!()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove for now

} else {
return Err(YdbError::Custom("unexpected session answer".to_string()));
}
println!("session started! {:?}", session_response);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trace!

},
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/+ describe test
/+ update test

@rekby rekby merged commit 903b6cd into ydb-platform:master Jan 23, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants