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

Move InMemorySubscriber from L2 communication module to L3 client mo… #158

Merged
merged 6 commits into from
Jul 16, 2024

Conversation

stevenhartley
Copy link

@stevenhartley stevenhartley commented Jul 16, 2024

The InMemorySubscriber actually was implementing the client-side of the uSubscription flow by talking to usubscription service, registering a listener (to receive published messages), and setting up a notifier to receive subscription changes. The only L2 item for pub/sub (subscriber) flow was to register a listener with the transport so there is no need to add a wrapper to do that. This change then also implements all the other remaining usubscription client side APIs for developers to use and removes the L2 Subscriber to avoid confusion with this InMemoryUSubscriptionClient implementation. The uProtocol client-side implementations will now reside in the client folder of up-java (ex. uDiscovery & uTwin).

#148

…ule.

The InMemorySubscriber actually was implementing the client-side of the uSubscription flow by talking to usubscription service, registering a listener (to receive published messages), and setting up a notifier to receive subscription changes. The only L2 item for pub/sub (subscriber) flow was to register a listener with the transport so there is no need to add a wrapper to do that.
This change then also implements all the other remaining usubscription client side APIs for developers to use and removes the L2 Subscriber to avoid confusion with this InMemoryUSubscriptionClient implementation. The uProtocol client-side implementations will now reside in the client folder of up-java (ex. uDiscovery & uTwin).

#148
Copy link

Code coverage report is ready! 📈

Copy link

Code coverage report is ready! 📈

…will be done by USubscription service so streamer can register for all notification changes
@stevenhartley stevenhartley marked this pull request as ready for review July 16, 2024 19:24
Copy link

Code coverage report is ready! 📈

* @param options the call options to use for the RPC requests
*/
public InMemoryUSubscriptionClient (UTransport transport, RpcClient rpcClient,
Notifier notifier, CallOptions options) {
Copy link

Choose a reason for hiding this comment

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

CallOptions contains auth token and it is immutable. When token expires it has to be refreshed, so the current implementation will require to rebuild the whole instance just to update token, I think it is better to pass options into each RPC method.

Copy link
Author

Choose a reason for hiding this comment

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

ok fixed

Copy link

Code coverage report is ready! 📈

Copy link

Code coverage report is ready! 📈

Copy link
Contributor

Choose a reason for hiding this comment

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

Add copyright header

Copy link
Author

Choose a reason for hiding this comment

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

done

Copy link
Author

Choose a reason for hiding this comment

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

done

@@ -98,8 +115,8 @@ public InMemorySubscriber (UTransport transport, RpcClient rpcClient, Notifier n
* subscribed to said topic.
*
* @param topic The topic to subscribe to.
* @param listener The listener to be called when a message is received on the topic.
* @param options The call options for the subscription.
* @param listener The listener to be called when a messages are received.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove the article 'a'.

Copy link
Author

Choose a reason for hiding this comment

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

done

Copy link

Code coverage report is ready! 📈

Copy link
Contributor

@neelam-kushwah neelam-kushwah left a comment

Choose a reason for hiding this comment

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

LGTM

@stevenhartley stevenhartley merged commit 39c4d05 into main Jul 16, 2024
6 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.

3 participants