-
Notifications
You must be signed in to change notification settings - Fork 1
Implement QoS 1 #21
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
Implement QoS 1 #21
Conversation
| boolean SUBSCRIPTION_IDENTIFIER_AVAILABLE_DEFAULT = false; | ||
|
|
||
| int PACKET_ID_FOR_QOS_0 = 0; | ||
| int PACKET_ID_MAX = 0xFFFF; |
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.
Is MAXIMUM_PACKET_ID the same ?
| return; | ||
| } | ||
|
|
||
| pendingPublishes.runInWriteLock(publishes -> { |
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.
please extract to method
| @Override | ||
| public void resendPendingPacketsAsync(@NotNull MqttClient client, int retryInterval) { | ||
| var currentTime = System.currentTimeMillis(); | ||
| var stamp = pendingPublishes.readLock(); |
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.
runInReadLock can be used
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.
we don't have a version of this method with one object and one primitive argument
| } | ||
|
|
||
| @Override | ||
| public @NotNull Mono<Boolean> store(@NotNull String clientId, @NotNull MqttSession session, long expiryInterval) { |
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.
Please make multi line
| pendingPublishes.runInWriteLock(Collection::clear); | ||
| } | ||
|
|
||
| private void removeExpiredPackets(@NotNull Array<PendingPublish> publishes) { |
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.
It can be static
Implement QoS 1