supriya-project / supriya

A Python API for SuperCollider
http://supriya-project.github.io/supriya
MIT License
252 stars 29 forks source link

Refactor server lifecycle management #403

Closed josephine-wolf-oberholtzer closed 2 months ago

josephine-wolf-oberholtzer commented 2 months ago

Use a single dedicated function for managing the lifecycle of a server (sync or async), with the control flow in that function managed entirely by futures.

This guarantees that lifecycle event callbacks only execute inside that single lifecycle management function, allowing for async callbacks to be executed in order without needing to resort to spawning new tasks.

This also generally simplifies the server implementation(s), drastically reducing the complexity of callbacks between server, OSC protocol and process prototol.