Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
aa23bcda
Commit
aa23bcda
authored
Dec 21, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
4672ebb0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
go/zodb/connection.go
go/zodb/connection.go
+11
-1
go/zodb/persistent.go
go/zodb/persistent.go
+1
-1
go/zodb/persistent_test.go
go/zodb/persistent_test.go
+1
-0
No files found.
go/zodb/connection.go
View file @
aa23bcda
...
...
@@ -118,7 +118,7 @@ type LiveCache struct {
objtab
map
[
Oid
]
*
weak
.
Ref
// oid -> weak.Ref(IPersistent)
// hooks for application to influence live caching decisions.
c
acheC
ontrol
LiveCacheControl
control
LiveCacheControl
}
// LiveCacheControl is the interface that allows applications to influence
...
...
@@ -182,6 +182,16 @@ func (cache *LiveCache) Get(oid Oid) IPersistent {
return
obj
}
// SetControl installs c to handle cache decisions.
//
// Any previously installed cache control is uninstalled.
// Passing nil sets the cache to have no control installed at all.
//
// It is not safe to call SetControl simultaneously to other cache operations.
func
(
cache
*
LiveCache
)
SetControl
(
c
LiveCacheControl
)
{
cache
.
control
=
c
}
// get is like Get, but used when we already know object class.
//
// Use-case: in ZODB references are (pyclass, oid), so new ghost is created
...
...
go/zodb/persistent.go
View file @
aa23bcda
...
...
@@ -224,7 +224,7 @@ func (obj *Persistent) PDeactivate() {
// no constant load/unload on object access. XXX -> MRU cache?
// NOTE wcfs manages its objects explicitly and does not need this.
if
cc
:=
obj
.
jar
.
cache
.
c
acheC
ontrol
;
cc
!=
nil
{
if
cc
:=
obj
.
jar
.
cache
.
control
;
cc
!=
nil
{
if
!
cc
.
WantEvict
(
obj
.
instance
)
{
return
}
...
...
go/zodb/persistent_test.go
View file @
aa23bcda
...
...
@@ -137,4 +137,5 @@ func TestPersistent(t *testing.T) {
// TODO activate again - refcnt++
// TODO deactivate - refcnt--
// TODO deactivate - state dropped
// TODO invalidate - must be on txn boundary; state dropped
}
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