Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
0c484705
Commit
0c484705
authored
Dec 19, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
9c8c5bdd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
38 deletions
+13
-38
go/zodb/storage/zeo/zeo.go
go/zodb/storage/zeo/zeo.go
+1
-4
go/zodb/zodb.go
go/zodb/zodb.go
+12
-34
No files found.
go/zodb/storage/zeo/zeo.go
View file @
0c484705
...
@@ -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
}
}
...
...
go/zodb/zodb.go
View file @
0c484705
...
@@ -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
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment