Commit 0c484705 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 9c8c5bdd
...@@ -91,9 +91,6 @@ func (z *zeo) Iterate(ctx context.Context, tidMin, tidMax zodb.Tid) zodb.ITxnIte ...@@ -91,9 +91,6 @@ func (z *zeo) Iterate(ctx context.Context, tidMin, tidMax zodb.Tid) zodb.ITxnIte
panic("TODO") panic("TODO")
} }
func (z *zeo) Watch(ctx context.Context) (zodb.Tid, []zodb.Oid, error) {
panic("TODO")
}
// errorUnexpectedReply is returned by zLink.Call callers when reply was // errorUnexpectedReply is returned by zLink.Call callers when reply was
// received successfully, but is not what the caller expected. // received successfully, but is not what the caller expected.
...@@ -315,7 +312,7 @@ func openByURL(ctx context.Context, u *url.URL, opt *zodb.DriverOptions) (_ zodb ...@@ -315,7 +312,7 @@ func openByURL(ctx context.Context, u *url.URL, opt *zodb.DriverOptions) (_ zodb
panic("TODO watchq") panic("TODO watchq")
} }
zl, err := dialZLink(ctx, net, addr) // XXX + methodTable zl, err := dialZLink(ctx, net, addr) // XXX + methodTable {invalidateTransaction tid, oidv} -> ...
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
...@@ -323,19 +323,21 @@ func (e *OpError) Cause() error { ...@@ -323,19 +323,21 @@ func (e *OpError) Cause() error {
// IStorage is the interface provided by opened ZODB storage. // IStorage is the interface provided by opened ZODB storage.
type IStorage interface { type IStorage interface {
//IStorageDriver
// same as in IStorageDriver // same as in IStorageDriver
URL() string URL() string
Close() error Close() error
LastTid(context.Context) (Tid, error) LastTid(context.Context) (Tid, error)
Loader Loader
Iterator Iterator
// no watcher
// additional to IStorageDriver // additional to IStorageDriver
Prefetcher Prefetcher
//XXXNotifier() -> Notifier // dedicated notifier for every open?
// Watch returns new watcher over the storage.
//
// The watcher represents invalidation channel (notify about changes
// made to DB). XXX
//Watch() Watcher XXX -> Watch(watchq) ? (then how to unsubscribe)
} }
// Prefetcher provides functionality to prefetch objects. // Prefetcher provides functionality to prefetch objects.
...@@ -369,23 +371,6 @@ type IStorageDriver interface { ...@@ -369,23 +371,6 @@ type IStorageDriver interface {
// A storage driver also delivers database change events to watchq // A storage driver also delivers database change events to watchq
// channel, which is passed to it when the driver is created. // channel, which is passed to it when the driver is created.
/* XXX kill
Watcher
// Notifier returns storage driver notifier.
//
// The notifier represents invalidation channel (notify about changes
// made to DB). XXX
//
// To simplify drivers, there must be only 1 logical user of
// storage-driver level notifier interface. Contrary IStorage allows
// for several users of notification channel. XXX ok?
//Notifier() Notifier
// XXX Watch() -> Watcher
// XXX SetWatcher(watchq) SetWatchSink() ? XXX -> ctor ?
*/
} }
// Loader provides functionality to load objects. // Loader provides functionality to load objects.
...@@ -449,18 +434,6 @@ type Committer interface { ...@@ -449,18 +434,6 @@ type Committer interface {
} }
/*
// Notifier allows to be notified of changes made to database by other clients.
type Notifier interface {
// Read returns next notification event.
//
// XXX ...
// XXX overflow -> special error
Read(ctx context.Context) (Tid, []Oid, error)
}
*/
// WatchEvent is one event describing observed database change. // WatchEvent is one event describing observed database change.
type WatchEvent struct { type WatchEvent struct {
Tid Tid Tid Tid
...@@ -473,7 +446,12 @@ type Watcher interface { ...@@ -473,7 +446,12 @@ type Watcher interface {
// Watch waits-for and returns next event corresponding to comitted transaction. // Watch waits-for and returns next event corresponding to comitted transaction.
// //
// XXX queue overflow -> special error? // XXX queue overflow -> special error?
Watch(ctx context.Context) (Tid, []Oid, error) Watch(ctx context.Context) (WatchEvent, error) // XXX name -> Read? ReadEvent?
// Close stops the watcher.
// err is always nil. XXX ok?
Close() error
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment