Library Specific data

For kicks, I decided to put together a pair of libraries (one for use by an imp agent, one for use on the smart things cloud) that would allow developers to represent their imps as virtual devices on the smart things cloud. As part of the process, it becomes necessary to save authentication token information for continuing communications with the ST cloud. While I could task the user with saving this data, it occurred to me that having a mechanism for a library to save and load its own data within the imp cloud might be a useful and common feature, (as I understand agent data persistence to work, it would be very easy, especially given an asynchronous workflow, for a user of said library to accidentally overwrite the token settings set by the library) but aside from asking here on the forums, I am not really sure how to go about finding out if such a thing exists.

Does such a thing exist?


It would be entirely possible for the library (since it’s running in the agent VM) to overwrite the agent application’s persisted data and vice versa. But this is why the library should be subsidiary to the application, ie. the application instantiates the library class and manages that class through the values (API keys etc) it passes into the library class’ constructor and can therefore manage the persistence of that info.