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

Queue Subscribes #263

Closed
RangerMauve opened this issue Apr 4, 2016 · 8 comments
Closed

Queue Subscribes #263

RangerMauve opened this issue Apr 4, 2016 · 8 comments

Comments

@RangerMauve
Copy link
Contributor

I've been using the master branch for connecting to my device, and reading/writing seems to queue up just fine. However, I'm experiencing issues subscribing to a certain notification. Specifically, it errors out here saying that it was "Unable to write descriptor". Now, I have all my writes/reads/subscribes happening at almost the same time because this was handled properly with queuing in the library I had previously worked with.

I'm assuming it's an issue with the subscribe failing because either one of my reads or writes are happening at the same time it's attempting to write to the descriptor.

I'm testing this on Android 5.1.1, with cordova platform 5.1.1.

Would a PR be welcome to add this feature? Are there any workarounds I can take in the meantime? (I'm thinking I'll just add an artificial delay to the subscribe call in the API wrapper I made)

@randdusing
Copy link
Owner

@RangerMauve Thanks for trying out the master branch. A PR would be welcome, but I may be able to work on it over the next few days. It should be pretty straightforward to recreate the functionality for read/writeDescriptors and subscribe/unsubscribe.

In the meantime, a delay is your best option even if it's a bit hacky. If you're using the Angular wrapper, you could also try chaining the promises together.

@RangerMauve
Copy link
Contributor Author

Adding a delay of a few seconds seems to have done it for now. I'll see if I have time to allocate to this tomorrow if you haven't gotten to it by then. Lots of other stuff piling up at the same time, sadly. :P

@randdusing
Copy link
Owner

I'm making some updates as we speak and will be testing later today. If all goes well, should see it merged to master branch sometime tonight.

@RangerMauve
Copy link
Contributor Author

Perfect. Then I'll give it a field test tomorrow morning.

@randdusing
Copy link
Owner

@RangerMauve I updated master with queueing support for all the operations. Let me know if you run into any issues.

@RangerMauve
Copy link
Contributor Author

Bleh, I have to take care of some other things first. Will probably have some time later this afternoon to devote to this again.

@RangerMauve
Copy link
Contributor Author

I've got the code currently in master running out in the wild for a couple of days now and it's all running smoothly as far as I can tell. Thanks!

@randdusing
Copy link
Owner

Cool, glad it's working out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants