MS-Painter / Folden

Cross platform PC application. System wide file watchers handling made simple.
MIT License
20 stars 3 forks source link

Server as a service feature - Mapping serialization #6

Closed MS-Painter closed 3 years ago

MS-Painter commented 3 years ago

Currently the server mapping data can't be serialized.

This is because of the thread sync sender object stored for each handler,

Which allows us to send messages to handler threads.

We'd want to de/serialize the mapping object to allow starting up handlers already registered on service startup.

Can we store a different object to use to access the sender object through?

Can the sender object on the mapping object be omitted from de/serialization? Since it would be dead anyways and has no use for the starting up service as it would re-create threads and update the mapping anyways. Alternatively implementing a de/serialization for this field on the mapping which would store a dead fake sender object.

MS-Painter commented 3 years ago

Encapusalte in an Option perhaps? Or some other way to allow the value to possibly be nullable