Skip to content
This repository has been archived by the owner on Feb 12, 2019. It is now read-only.

Added queue for notifications to prevent pebble from crashing fixes #20 #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

smurfy
Copy link
Contributor

@smurfy smurfy commented Aug 22, 2014

I added a queue system which only sends one notification every 250ms to the pebble.
I tested with 256 messages in the queue and pebble does not crash. (crashes if you don't delay)

Queuing is in a thread so it does not interfere with other pebble communication.

@smokku
Copy link
Owner

smokku commented Aug 23, 2014

Shouldn't this be implemented in WatchConnector?

@smurfy
Copy link
Contributor Author

smurfy commented Aug 23, 2014

I thought about it, but then decided to implemented it not in the connector because the queue is a high level fuction, while the communication itself is lowlevel.

But if you like i can move the code over.

@smokku
Copy link
Owner

smokku commented Aug 24, 2014

With current implementation it is still possible to flood Pebble with messages. Only notifications source of messages is protected - others are not. i.e. I could flood Pebble with MUSIC messages.

@smurfy
Copy link
Contributor Author

smurfy commented Aug 25, 2014

Ok, makes sense, i will update my PR over the next couple of days.

@bsx
Copy link

bsx commented Aug 25, 2014

Perhaps it would also make sense to have a maximum queue length and drop messages after that, otherwise you might add several thousand messages to the queue and keep the Pebble busy for a while. The queue length could maybe even be configurable through the UI.

@smurfy
Copy link
Contributor Author

smurfy commented Aug 25, 2014

@bsx yea makes sense. whats the best approach, dropping new messages or old ones?

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

Successfully merging this pull request may close these issues.

None yet

3 participants