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

A basic rework of the API using Promises and PushStreams #420

Merged
merged 2 commits into from
Sep 29, 2017

Conversation

timothyjward
Copy link

This commit adds an example API based purely on Promises and PushStreams. It removes the lifecycle and callback management from the MQTTToken, using it instead as a holder for static information. This allows the API to be simplified quite a lot, and for the API to start using immutable types when calling back into client code.

The new API is in the org.eclipse.paho.mqttv5.client.alpha package, and the MqttAsyncClient is a simple adapter from the old API to the alpha API. Everything should be using generics to ensure type safety, but I'm sure that a more optimal implementation would be possible with some work in the core code.

There is a simple example of using the code in the test client. As per my comments in issue #389 I'm happy to answer questions, and I thought a concrete example of using Promises/streams might prove helpful.

Signed-off-by: Tim Ward timothyjward@apache.org

This change adds an example API based purely on Promises and PushStreams. It removes the lifecycle and callback management from the MQTTToken, using it instead as a holder for static information. This allows the API to be simplified quite a lot, and for the API to start using immutable types when calling back into client code.

The new API is in the org.eclipse.paho.mqttv5.client.alpha package, and the MqttAsyncClient is a simple adapter from the old API to the alpha API. Everything should be using generics to ensure type safety, but I'm sure that a more optimal implementation would be possible with some work in the core code.

Signed-off-by: Tim Ward <timothyjward@apache.org>
@jpwsutton
Copy link
Member

Thanks Tim, this looks fantastic. I'm just having a look at the changes now, but it looks like we need the OSGI snapshot repository in the pom. I can't find the repository URL on google either, could you let me know what it is please so that I can add it in?

Signed-off-by: Tim Ward <timothyjward@apache.org>
@timothyjward
Copy link
Author

Thanks Tim, this looks fantastic. I'm just having a look at the changes now, but it looks like we need the OSGI snapshot repository in the pom. I can't find the repository URL on google either, could you let me know what it is please so that I can add it in?

Sorry about that - I must have been distracted at the wrong point and just used the artifacts in my local repo. I thought the easiest thing would be to push another commit onto the PR :)

@timothyjward
Copy link
Author

I have now also signed the ECA

@jpwsutton jpwsutton merged commit 6b608a7 into eclipse:mqttv5-new Sep 29, 2017
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.

None yet

2 participants