-
Notifications
You must be signed in to change notification settings - Fork 20
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
Semaphore API #162
Conversation
b998249
to
809d51d
Compare
809d51d
to
cce3e61
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great work!
ydb/examples/mutex.rs
Outdated
println!("done"); | ||
|
||
let mut handles: Vec<JoinHandle<()>> = vec![]; | ||
for _ in range(0, 4) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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>>, |
There was a problem hiding this comment.
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>>, |
There was a problem hiding this comment.
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!() |
There was a problem hiding this comment.
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), | ||
} |
There was a problem hiding this comment.
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), | ||
} |
There was a problem hiding this comment.
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!() |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trace!
}, | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/+ describe test
/+ update test
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:
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Other information