Mercurial > code > home > repos > rdfdb
changeset 62:bd0e24f6254a
doc update on SyncedGraph
Ignore-this: cec485f067fbde38bd99766e1c57eb68
author | drewp@bigasterisk.com |
---|---|
date | Fri, 31 May 2019 02:51:08 +0000 |
parents | 9b46968b8881 |
children | a3718b297d16 |
files | rdfdb/syncedgraph.py |
diffstat | 1 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/rdfdb/syncedgraph.py Thu May 30 08:38:13 2019 +0000 +++ b/rdfdb/syncedgraph.py Fri May 31 02:51:08 2019 +0000 @@ -42,10 +42,16 @@ class SyncedGraph(CurrentStateGraphApi, AutoDepGraphApi, GraphEditApi): """ graph for clients to use. Changes are synced with the master graph - in the rdfdb process. + in the rdfdb process. + + self.patch(p: Patch) is the only way to write to the graph. - This api is like rdflib.Graph but it can also call you back when - there are graph changes to the parts you previously read. + Reading can be done with the AutoDepGraphApi methods which set up + watchers to call you back when the results of the read have + changed (like knockoutjs). Or you can read with + CurrentStateGraphApi which doesn't have watchers, but you have to + opt into using it so it's clear you aren't in an auto-dep context + and meant to set up watchers. You may want to attach to self.initiallySynced deferred so you don't attempt patches before we've heard the initial contents of @@ -54,8 +60,7 @@ statements unless we have the correct graph. If we get out of sync, we abandon our local graph (even any - pending local changes) and get the data again from the - server. + pending local changes) and get the data again from the server. """ def __init__(self,