LinkToPy icon indicating copy to clipboard operation
LinkToPy copied to clipboard

terminating in a clean/thread safe manner

Open mungewell opened this issue 3 years ago • 1 comments

Are there any suggestions how a script should close down a LinkToPy session?

I see that the code starts up a new thread and runs (or attempts to) a Carabiner executable.

    def start_carabiner(self, path_to_car):
        print(path_to_car)
        os.system(path_to_car +" >car_logs.log")

Is there a way to close/terminate this executable? Or a way to sense that there's already one running (TCP port??) and not (to attempt) to start a new one?

mungewell avatar Feb 21 '22 18:02 mungewell

This now behaves a lot nicer with my 'toggle_bpm' example.

I have the _listener terminating when it can no longer talk to a Carabiner process, maybe the system should automatically attempt to reconnect, or fire up a Carabiner process of its self.

mungewell avatar Feb 21 '22 21:02 mungewell