Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
Kirill Smelkov
ZODB
Commits
52c58392
Commit
52c58392
authored
Jul 26, 2002
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reformat a smidgeon of code.
parent
12cc4e41
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
src/ZEO/trigger.py
src/ZEO/trigger.py
+18
-18
No files found.
src/ZEO/trigger.py
View file @
52c58392
...
@@ -128,57 +128,57 @@ else:
...
@@ -128,57 +128,57 @@ else:
w
.
setsockopt
(
socket
.
IPPROTO_TCP
,
1
,
1
)
w
.
setsockopt
(
socket
.
IPPROTO_TCP
,
1
,
1
)
# tricky: get a pair of connected sockets
# tricky: get a pair of connected sockets
host
=
'127.0.0.1'
host
=
'127.0.0.1'
port
=
19999
port
=
19999
while
1
:
while
1
:
try
:
try
:
self
.
address
=
(
host
,
port
)
self
.
address
=
host
,
port
a
.
bind
(
self
.
address
)
a
.
bind
(
self
.
address
)
break
break
except
:
except
:
if
port
<=
19950
:
if
port
<=
19950
:
raise
'Bind Error'
,
'Cannot bind trigger!'
raise
'Bind Error'
,
'Cannot bind trigger!'
port
=
port
-
1
port
-=
1
a
.
listen
(
1
)
a
.
listen
(
1
)
w
.
setblocking
(
0
)
w
.
setblocking
(
0
)
try
:
try
:
w
.
connect
(
self
.
address
)
w
.
connect
(
self
.
address
)
except
:
except
:
pass
pass
r
,
addr
=
a
.
accept
()
r
,
addr
=
a
.
accept
()
a
.
close
()
a
.
close
()
w
.
setblocking
(
1
)
w
.
setblocking
(
1
)
self
.
trigger
=
w
self
.
trigger
=
w
asyncore
.
dispatcher
.
__init__
(
self
,
r
)
asyncore
.
dispatcher
.
__init__
(
self
,
r
)
self
.
lock
=
thread
.
allocate_lock
()
self
.
lock
=
thread
.
allocate_lock
()
self
.
thunks
=
[]
self
.
thunks
=
[]
self
.
_trigger_connected
=
0
self
.
_trigger_connected
=
0
def
__repr__
(
self
):
def
__repr__
(
self
):
return
'<select-trigger (loopback) at %x>'
%
id
(
self
)
return
'<select-trigger (loopback) at %x>'
%
id
(
self
)
def
readable
(
self
):
def
readable
(
self
):
return
1
return
1
def
writable
(
self
):
def
writable
(
self
):
return
0
return
0
def
handle_connect
(
self
):
def
handle_connect
(
self
):
pass
pass
def
pull_trigger
(
self
,
thunk
=
None
):
def
pull_trigger
(
self
,
thunk
=
None
):
if
thunk
:
if
thunk
:
try
:
try
:
self
.
lock
.
acquire
()
self
.
lock
.
acquire
()
self
.
thunks
.
append
(
thunk
)
self
.
thunks
.
append
(
thunk
)
finally
:
finally
:
self
.
lock
.
release
()
self
.
lock
.
release
()
self
.
trigger
.
send
(
'x'
)
self
.
trigger
.
send
(
'x'
)
def
handle_read
(
self
):
def
handle_read
(
self
):
self
.
recv
(
8192
)
self
.
recv
(
8192
)
try
:
try
:
self
.
lock
.
acquire
()
self
.
lock
.
acquire
()
for
thunk
in
self
.
thunks
:
for
thunk
in
self
.
thunks
:
...
...
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