Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
8daa72b8
Commit
8daa72b8
authored
Dec 23, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
b0b8350f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
3 deletions
+30
-3
bigfile/_file_zodb.pyx
bigfile/_file_zodb.pyx
+30
-3
No files found.
bigfile/_file_zodb.pyx
View file @
8daa72b8
...
...
@@ -101,7 +101,7 @@ cdef public class _ZBigFile(BigFile) [object _ZBigFile, type _ZBigFile_Type]:
if
zf
.
wfileh
==
nil
:
zconn
=
zf
.
zself
.
_p_jar
assert
zconn
is
not
None
# XXX locking? or rely on that ZODB objects for must be used from under 1 thread only?
# XXX locking? or rely on that ZODB objects for
zconn
must be used from under 1 thread only?
# join zconn to wconn; link to wconn from _ZBigFile
pywconn
=
pywconnOf
(
zconn
)
...
...
@@ -132,7 +132,34 @@ cdef wcfs.PyConn pywconnOf(zconn):
wc
=
pywcfs
.
join
(
zurl
)
wconn
=
wc
.
connect
(
zconn_at
(
zconn
))
# XXX register zconn synchronizer to wconn.resync on zconn open
# XXX zconn goes away -> wconn close & free
zconn
.
_wcfs_wconn
=
wconn
# keep wconn view of the database in sync with zconn
zconn
.
_wcfs_wconn_zsync
=
ZSync
(
zconn
,
wconn
)
return
wconn
# ZSync keeps wconn in sync with zconn.
# XXX -> make generic and usefor _ZBigFileH too?
# XXX naming?
class
ZSync
:
# .zconn
# .wconn
def
__init__
(
zsync
,
zconn
,
wconn
):
print
(
'ZSync %r %r'
%
(
zconn
,
wconn
))
assert
zconn
.
open
zsync
.
zconn
=
zconn
# XXX -> weakref
zsync
.
wconn
=
wconn
# when connection will be reopened -> zsync.on_connection_open()
zconn
.
onOpenCallback
(
zsync
)
# DB.open() pops .zconn from connection pool and "opens" for usage.
# -> resync .wconn to new database view of ZODB connection.
def
on_connection_open
(
zsync
):
print
(
'ZSync.resync %r %r'
%
(
zsync
.
zconn
,
zsync
.
wconn
))
zsync
.
wconn
.
resync
(
zconn_at
(
zsync
.
zconn
))
# TODO zconn dealloc -> wconn.close
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