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

use async/await for mainloop #1059

Merged
merged 8 commits into from
Sep 6, 2022

Commits on Mar 11, 2022

  1. replace hook processes with tokio::process

    Previously, handling too many librespot events in a row, the spawned hook might not have been finished. In this case, the events would stack up, since the event channel then would not be polled.
    
    By using the tokio::process module, we gain support for waiting for processes asynchronously and even if an event would not be handled directly, it will be handled after the previous hook process has finished.
    eladyn committed Mar 11, 2022
    Configuration menu
    Copy the full SHA
    d8ff824 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    33ad39b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f3deda2 View commit details
    Browse the repository at this point in the history
  4. improve naming

    eladyn committed Mar 11, 2022
    Configuration menu
    Copy the full SHA
    826886a View commit details
    Browse the repository at this point in the history
  5. rewrite mainloop using async / await

    The mainloop code is simplified by relying on the async / await syntax
    instead of implementing all the futures ourselves. In doing so, this
    also works, if a different user connects during the playback.
    
    Additionally, the application chooses now between connecting using the
    users credentials and starting discovery. If there are valid
    credentials, no discovery stream is started at all, which prevents
    buggy and surprising behaviour.
    eladyn committed Mar 11, 2022
    Configuration menu
    Copy the full SHA
    7ea5d59 View commit details
    Browse the repository at this point in the history
  6. rename variables to not use local_

    Also remove an unneeded clone.
    eladyn committed Mar 11, 2022
    Configuration menu
    Copy the full SHA
    aebfdf1 View commit details
    Browse the repository at this point in the history
  7. use stack pinning in some cases

    Co-authored-by: Robin van Dijk <robin@robinjint.nl>
    eladyn and robinvd committed Mar 11, 2022
    Configuration menu
    Copy the full SHA
    de5c92e View commit details
    Browse the repository at this point in the history

Commits on May 7, 2022

  1. allow replacing orphaned dbus servers

    This works around the issue, where dbus servers would stay around until
    the application ends, although their corresponding session had already
    ended. New sessions were then unable to communicate through dbus. Now,
    newer servers will just replace any previous name owners.
    eladyn committed May 7, 2022
    Configuration menu
    Copy the full SHA
    89fa16d View commit details
    Browse the repository at this point in the history