team8 / FRC-2020-Public

5 stars 2 forks source link

Configs are not truly concurrent #6

Closed qhdwight closed 4 years ago

qhdwight commented 4 years ago

Thread that watches for file system changes is separate from main robot thread. It can possibly be writing to the config while the robot reads, causing an exception for non-primitive types. Solution is to have the robot thread check if file system thread has changes and accept them. This means a little hook has to be added in robot periodic.

qhdwight commented 4 years ago

Also, listen function should change. Either needs to be dropped or modified such that previous and new variables are supplied to consumer, or you can listen for specific fields. The latter is suspect since it would probably require referencing a field via a string.