Closed mcassaniti closed 2 years ago
There is an automatically added callback
argument to all functions marked with replicated
decorator. See the docs.
Also when you call them with sync=true
arguments - they will wait commit automatically. You can instead call them with callback=yourFunc
and you will receive a callback as soon as operation committed.
OK, excellent :smile: Is there any documentation on what gets passed to the result argument of the callback function?
It gets two arguments. First one is what your function returns (None
if nothing). And the second one - fail reason enum.
I took me a while to understand this even though the documentation does match what is supposed to happen. Thanks for the feedback. I've only just been able to take another look at pysyncobj
after all this time.
When a replicated object is updated and that update is committed, it would be useful to be able to run a callback when the update occurs. For example:
If this is already implemented then I apologise for asking, but it wasn't clear from the documentation.