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

New feature: queued packet sends #479

Merged
merged 27 commits into from Jun 16, 2019
Merged

Conversation

sidoh
Copy link
Owner

@sidoh sidoh commented Jun 16, 2019

This new feature adds a queue for packet sends, which allows the various integration points (REST, MQTT, etc.) to enqueue command packets instead of synchronously sending them.

The observable result to the user is for MQTT and UDP, vastly improved performance. Network commands are not blocked on sending the RF packets. They simply enqueue the commands they want sent and yield back to the system. In testing, I was able to send MQTT commands using mosquitto_pub with absolutely no throttling and there was no observable performance impact.

For REST, there is currently no difference. PUT/POST state still handle the command synchronously. If desired, this is easy to patch.

This change also enables new features like #113.

@sidoh sidoh merged commit 52d5c73 into v1.10.0-wip Jun 16, 2019
@sidoh sidoh deleted the feature/queued_packet_sends branch June 16, 2019 19:58
@sidoh sidoh added this to the 1.10.0 milestone Jun 16, 2019
@coehn1
Copy link

coehn1 commented Jun 17, 2019

Hi,
Great work!

  • For REST, there is currently no difference. PUT/POST state still handle the command synchronously. If desired, this is easy to patch.
    Could you please implement this?

@sidoh
Copy link
Owner Author

sidoh commented Jun 17, 2019

Yeah, I can look into it. I actually added special code to keep the REST API synchronous. PUT returns the state of the group after patching, but state is only updated after packets are sent. So it was returning invalid results.

I think the options are:

  • Make sync/async a setting
  • Make the API always asynchronous, and add a route to query the queue status
  • Make GET wait for sends to complete, update usages that rely on state PUT to instead GET after PUT

I'll think about which of these make the most sense. Let me know if you have opinions.

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