syncbase: watchable store layer
Beginnings of lightweight "watchable store" layer, enabling
client-side watch impl as well as sync module watching of
store commits.
Change-Id: If4de271f9ea0593ec8fb840f93fa22c6206f10b5
diff --git a/services/syncbase/server/nosql/database.go b/services/syncbase/server/nosql/database.go
index fcc2817..94664fb 100644
--- a/services/syncbase/server/nosql/database.go
+++ b/services/syncbase/server/nosql/database.go
@@ -10,6 +10,7 @@
"v.io/syncbase/x/ref/services/syncbase/server/util"
"v.io/syncbase/x/ref/services/syncbase/store"
"v.io/syncbase/x/ref/services/syncbase/store/memstore"
+ "v.io/syncbase/x/ref/services/syncbase/store/watchable"
"v.io/v23/context"
"v.io/v23/naming"
"v.io/v23/rpc"
@@ -39,10 +40,14 @@
return nil, verror.New(verror.ErrInternal, ctx, "perms must be specified")
}
// TODO(sadovsky): Make storage engine pluggable.
+ st, err := watchable.Wrap(memstore.New())
+ if err != nil {
+ return nil, err
+ }
d := &database{
name: name,
a: a,
- st: memstore.New(),
+ st: st,
}
data := &databaseData{
Name: d.name,