Frames-Proj / frames

6 stars 6 forks source link

Cached appdat #111

Closed ethanpailes closed 7 years ago

ethanpailes commented 7 years ago

This commit adds a CachedAppendableDataHandle class which gives appendable data the semantics that we know it should have.

Ownership of the cached DataIDHandles can be a little tricky. The CachedAppendableDataHandle has to own the cached handles to make sure that they don't get dropped, but it does not own the data handles that actually live on the SafeNET. To work around this there is a method called withAt that lets you execute a function in terms of a given DataIDHandle. The handle is garenteed to live long enough for the promise returned by the given callback to complete.