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 handling CLI commands without a running application instance #290

Merged
merged 6 commits into from
Nov 13, 2023

Conversation

aome510
Copy link
Owner

@aome510 aome510 commented Nov 12, 2023

Resolves #279

Changes

  • initialize a new client and spawn a separate thread for handling CLI commands without a running spotify_player instance
  • update CLI client code to support handling requests without the application's state
  • move mute_state from PlayerState struct to SimplifiedPlayback struct

Benchmarks

Without a running instance

  • playback next
$ time test_spotify_player playback next
________________________________________________________
Executed in    1.15 secs      fish           external
   usr time   28.03 millis    0.23 millis   27.80 millis
   sys time   18.36 millis    1.83 millis   16.54 millis
  • get key playback
> time test_spotify_player get key playback
________________________________________________________
Executed in    1.27 secs      fish           external
   usr time   29.29 millis    0.25 millis   29.04 millis
   sys time   23.85 millis    2.13 millis   21.71 millis

With a running instance

  • playback next
> time test_spotify_player playback next
________________________________________________________
Executed in   14.94 millis    fish           external
   usr time    7.58 millis    0.19 millis    7.39 millis
   sys time    5.54 millis    1.54 millis    4.00 millis
  • get key playback
> time test_spotify_player get key playback
________________________________________________________
Executed in   16.28 millis    fish           external
   usr time    7.54 millis    0.19 millis    7.35 millis
   sys time    5.90 millis    1.63 millis    4.27 millis

@aome510 aome510 merged commit e4d1cc1 into master Nov 13, 2023
3 checks passed
@aome510 aome510 deleted the cli-without-running-instance branch November 13, 2023 01:27
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

Successfully merging this pull request may close these issues.

Support handling CLI commands without a running spotify_player instance
1 participant