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

Request response streaming #860

Open
wants to merge 10 commits into
base: RequestResponseBinding
Choose a base branch
from

Conversation

bretambrose
Copy link
Contributor

  • Streaming operation bindings
  • Misc updates based on SDK hand-written client and user experience

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

mqttRequestResponseClientSubmitRequest(getNativeHandle(), request, future);
this.handleReadLock.lock();
try {
mqttRequestResponseClientSubmitRequest(getNativeHandle(), request, future);
Copy link
Contributor

Choose a reason for hiding this comment

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

With new locks, it's still possible that getNativeHandle() returns 0 here. Java_software_amazon_awssdk_crt_iot_MqttRequestResponseClient_mqttRequestResponseClientSubmitRequest should check for NULL, but currently it doesn't.

* native -> Java in the same call stack. This is true for both the request response client and streaming
* operations, allowing us to add this layer of safety.
*/
private final ReentrantReadWriteLock handleLock = new ReentrantReadWriteLock();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why reentrant lock? Creating new operations and closing the client can't call each unless I missed something.

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