Skip to content

Move to pooled channels and a streaming AppleScript shell #5

Open
ryanwhitney wants to merge 25 commits into
mainfrom
cleanup-connectivity
Open

Move to pooled channels and a streaming AppleScript shell #5
ryanwhitney wants to merge 25 commits into
mainfrom
cleanup-connectivity

Conversation

@ryanwhitney
Copy link
Copy Markdown
Owner

@ryanwhitney ryanwhitney commented Jul 5, 2025

Major change to the core of how Control communicates with apps.

Previously:

  • Open new channels for each command.
  • Send individual actions, follow with status scripts, parse response.
  • Send a heartbeat after each action to ensure we're still connected.

After this change, things are much more complicated:

  • Open dedicated channels that stay open: osascript -s s -l AppleScript -i
  • Open streaming interactive shells, parsing out responses as we go.

With dedicated channels and streaming shells, we hugely reduce the overhead in opening/closing channels and starting up osascript processes. This saves tiny—but significant—amounts of time, shaving 50–300ms per actions. This is especially noticeable when pressing the play/pause button which switches state based on server response or updating the volume slider.

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.

1 participant