Commit c3fd8cf3 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent e38d6b5a
......@@ -43,6 +43,7 @@ type DB struct {
connv []*Connection // order by ↑= .at
// information about invalidations
// XXX -> Storage. XXX or -> Cache? (so it is not duplicated many times for many DB case)
invTab []invEntry // order by ↑= .tid
}
......@@ -81,10 +82,13 @@ func (db *DB) Open(ctx context.Context) (*Connection, error) {
}
// wait till .invTab is up to date covering ≥ lastTid
// XXX reenable
/*
err = db.invTab.Wait(ctx, at)
if err != nil {
return nil, err
}
*/
// now we have both at and invalidation data covering it -> proceed to
// get connection from the pool.
......
......@@ -328,6 +328,16 @@ type IStorageDriver interface {
Loader
Iterator
// Notifier returns storage driver notifier.
//
// The notifier represents invalidation channel (notify about changes
// made to DB not by us from outside). XXX
//
// To simplify drivets, there must be only 1 logical user of
// storage-driver level notifier interface. Ccontrary IStorage allows
// for several users of notification channel. XXX ok?
Notifier() Notifier
}
// Loader provides functionality to load objects.
......@@ -391,9 +401,14 @@ type Committer interface {
}
// Notifier allows to be notified of database changes made by other clients.
// Notifier allows to be notified of changes made to database by other clients.
type Notifier interface {
// TODO: invalidation channel (notify about changes made to DB not by us from outside)
// Read returns next notification event.
//
// XXX ...
// XXX overflow -> special error
Read(ctx context.Context) (Tid, []Oid, 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