question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could you write a bit how the queue command works?

Queueing commands, so you can don’t have to wait anymore for the completion of a command before issueing the next command

For example if I send following commands to the Bluetooth device:

writeCharacteristic(A)
writeCharacteristic(B)
setNotify(XYZ)
writeCharacteristic(C)

then I assume all commands are queued executed on each success? Case A: invoke write A -> successful written A -> invoke write B -> successful written B -> set notfiy XYZ -> succesful notfied XYZ -> invoke write C -> successful written C

or are they only queued invoked but not wait for a successful completion? Case B: invoke write A -> invoke write B ->set notfiy XYZ -> invoke write C-> successful written B -> successful written A -> succesful notfied XYZ -> successful written C

For my program I need the case A but I think you implemented case B, am I right?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
weliemcommented, Aug 21, 2019

Ok, that looks ok. You can also very clearly see here that ‘Case A’ is implemented…

BLESSED doesn’t add any delay to commands. Once one command is completed, the next one is executed immediately without any delay. This should not be any problem in normal case. If there is a device that really needs a delay, then the delay is always needed and not sometimes. In other words, if your Yunmai scale is working fine and the other isn’t then it is very unlikely that adding delays would solve anything.

I see a number of potential causes for the issue that was logged for OpenScale:

  • The scale is out of battery and hence behaving erratic. I have seen this happen many times. So replace batteries with new ones and see if the problems persist.
  • The scale is a ‘bad state’. Factory resetting it or pulling the batteries briefly may solve the issue.
  • The Bluetooth stack on the phone is messed up. Reboot your phone and try again.

There is one more possibility and that it is a threading issue. I recently pushed a commit to fix a potential threading issue that could block the queue. It will be included in the next release but I think it is very unlikely that this is causing the issue. I never saw the threading issue in practice and only noticed it when doing code reviews.

0reactions
weliemcommented, Sep 2, 2019

Ok, I see from the issue that there doesn’t seem to be queue issue anymore. So closing this issue…

I will think about how to extend the list of callbacks so that you can do more logging and get back to you…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Command queue - Wikipedia
In computer science, a command queue is a queue for enabling the delay of command execution, either in order of priority, on a...
Read more >
Message queue control commands - IBM
You can control message queues by using MQSC commands that are issued on the IBM MQ Appliance command line.
Read more >
How to run commands as in a queue - Super User
Is there a way I can run commands as a queue and sort of add more commands to that queue while things are...
Read more >
Queue Commands and Job Management - NIU
More on Queue Commands and Job Management ... Use this command to request the status of jobs, queues or batch servers. If JobID...
Read more >
rabbitmq-queues(8)
rabbitmq-queues is a command line tool that provides commands used to manage queues, for example, grow, shrink or rebalance replicas of replicated queue...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found