deepstream.io-client-js icon indicating copy to clipboard operation
deepstream.io-client-js copied to clipboard

Write confirmation callbacks in lists

Open airguru opened this issue 8 years ago • 1 comments

Based on https://github.com/deepstreamIO/deepstream.io/issues/458, records eventually got an explicit write confirmation in a callback. Would it make sense (client-side) to add callback-enabled versions for methods modifying Lists? Currently they only seem to use record.set() without the callback.

In general, we are trying to accomplish a transaction-like behaviour. When modifying data, we reserve the data access to only one client and let him wait for all write callbacks before releasing the access. We have to be sure, that by the time other clients reads the modified data, all of the writes were propagated and could not be read in some half-done state. Do I assume correctly that waiting for write callbacks guarantees this?

airguru avatar Oct 26 '17 09:10 airguru

I don't see any problem with this. Quick win

AlexBHarley avatar Oct 26 '17 10:10 AlexBHarley