Asynchrone or batch requests
Opened this issue · 0 comments
mjal commented
I would be able to send multiple commands instantly. ATM I have to wait each command to finish before sending another.
I now that I can create groups to do this but it's not as flexible.
For exemple phue allow to send a command to a list of lamps or a list of groups, when specifiying an array for the id of the lightbulb or group.
# Turn lamp 2 on
b.set_light(2,'on', True)
# You can also control multiple lamps by sending a list as lamp_id
b.set_light( [1,2], 'on', True)
I use qhue because of the excellent support for remote connection, and I was wondering how to do the same.
But base on qhue internal, I'm not sure how to achieve this.
I think it could either be:
- Allowing to send a batch of command, or
- Returning a promise when sent with
async=True
I think that requests-futures
could be the good tool for this.