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

How to wait until update database is complete? #57

Closed
simon2x opened this issue Sep 18, 2015 · 2 comments
Closed

How to wait until update database is complete? #57

simon2x opened this issue Sep 18, 2015 · 2 comments

Comments

@simon2x
Copy link

simon2x commented Sep 18, 2015

Is it possible to wait until MPDclient().update() is complete?

i.e. mpc update --wait

@pcwalden
Copy link

Here is a code excerpt you might use:

                MPD2.send_idle()
                # do this periodically, e.g. in event loop
                canRead = select([MPD2], [], [])[0]
                if canRead:
                    event = MPD2.fetch_idle()
            if 'database' in event: # exit wait loop

@simon2x
Copy link
Author

simon2x commented Sep 20, 2015

Thanks, will give this a go.

@simon2x simon2x closed this as completed Sep 20, 2015
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