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

Support async usage ? #6

Open
ssssam opened this issue Jun 23, 2022 · 1 comment
Open

Support async usage ? #6

ssssam opened this issue Jun 23, 2022 · 1 comment

Comments

@ssssam
Copy link

ssssam commented Jun 23, 2022

First, thanks for publishing this great library - i'm having a lot of fun making things with it.

I noticed the Monome object has only a sync API - you must have a thread that wakes up and calls poll() regularly. The internals of the library are implemented as async though, does it make sense to expose a Future directly so callers can wait for events in the system poll() function, rather than having a thread that wakes up periodically?

I am no export on async rust nor realtime app development - I would assume that there's a tradeoff with realtime performance vs power consumption that each API user would have to make when choosing between sync vs async usage.

@padenot
Copy link
Owner

padenot commented Jun 24, 2022

I did it this way because usually I have a loop running a number of time per second, that updates the state (say, based on a musical clock) and draws on the device.

But I could see other types of applications, benefit from this, so we could certainly do it.

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

No branches or pull requests

2 participants