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

Send queue #6

Open
stamp opened this issue Dec 22, 2016 · 1 comment
Open

Send queue #6

stamp opened this issue Dec 22, 2016 · 1 comment

Comments

@stamp
Copy link
Member

stamp commented Dec 22, 2016

To be able to read/write information to nodes that are asleep we need to put commands in a send queue. Battery powered devices usually wake up something like each hour and is awake for about 1 second. During this time we need to send all the commands in the queue to that specific node.

There is already a IsAwake() function that returns a blocking channel that can be used to wait for a node to wake up.

An other solution could be to start a go-routine each time we are going to send a message and first call the IsAwake() function. That way the go-routine will wait to send the message until the node is awake.

@jonaz
Copy link
Member

jonaz commented Dec 22, 2016

Does order matter here? If not i think the second solution with multiple waiting goroutines is better. But if we need a specific order we should have one goroutine per device with a queue in it.

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