NASA-AMMOS / aerie

A software framework for modeling spacecraft.
https://nasa-ammos.github.io/aerie-docs/
MIT License
73 stars 19 forks source link

Make MissionModels implement `AutoClosable` #1316

Open Mythicaeda opened 10 months ago

Mythicaeda commented 10 months ago

Follow up from a discussion with @DavidLegg.

Having mission models implement AutoClosable would allow them to clean up, for example, network resources or, specific to our discussion, save off a cache/log.

This would additionally allow us to resolve the TODO on L298 of LocalMissionModelService by wrapping the return in a try-with-resources to get the model. By having the close run explicitly outside of the simulation context, this should also prevent the model's close from doing anything sneaky with simulation/sim resources.