goblint / GobPie

Goblint IDE integration via MagpieBridge
MIT License
5 stars 3 forks source link

Goblint server automatic restart #25

Closed karoliineh closed 2 years ago

karoliineh commented 2 years ago

Closes #23 and #24

The latter is implemented using FileAlterationObserver because this allows tracking the fileChangedevent. The WatchService, that was used previously for determining whether the socket file has been made and waiting until it is, was not good for this case, because it expects a while loop, which halts the process until something happens, so it should've been done in a separate thread, but synchronizing the threads later would have been a headache. FileAlterationObserver lets one check whether any files were changed compared to the previous time the file was encountered and if so, take action without needing to halt and wait for an event to happen.