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
b459d85f
Commit
b459d85f
authored
Nov 06, 2013
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib.connection: use standard python library class instead of OnTimeout.
Update (only) user.
parent
e4601dc0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
15 deletions
+7
-15
neo/client/app.py
neo/client/app.py
+7
-2
neo/lib/connection.py
neo/lib/connection.py
+0
-13
No files found.
neo/client/app.py
View file @
b459d85f
...
...
@@ -20,6 +20,7 @@ from neo.lib.locking import Empty
from
random
import
shuffle
import
heapq
import
time
from
functools
import
partial
from
ZODB.POSException
import
UndoError
,
StorageTransactionError
,
ConflictError
from
ZODB.POSException
import
ReadConflictError
...
...
@@ -32,7 +33,7 @@ from neo.lib.protocol import NodeTypes, Packets, \
from
neo.lib.event
import
EventManager
from
neo.lib.util
import
makeChecksum
as
real_makeChecksum
,
dump
from
neo.lib.locking
import
Lock
from
neo.lib.connection
import
MTClientConnection
,
OnTimeout
,
ConnectionClosed
from
neo.lib.connection
import
MTClientConnection
,
ConnectionClosed
from
neo.lib.node
import
NodeManager
from
neo.lib.connector
import
getConnectorHandler
from
.exception
import
NEOStorageError
,
NEOStorageCreationUndoneError
...
...
@@ -530,7 +531,11 @@ class Application(object):
compressed_data
=
data
checksum
=
makeChecksum
(
compressed_data
)
txn_context
[
'data_size'
]
+=
size
on_timeout
=
OnTimeout
(
self
.
onStoreTimeout
,
txn_context
,
oid
)
on_timeout
=
partial
(
self
.
onStoreTimeout
,
txn_context
=
txn_context
,
oid
=
oid
,
)
# Store object in tmp cache
txn_context
[
'data_dict'
][
oid
]
=
data
# Store data on each node
...
...
neo/lib/connection.py
View file @
b459d85f
...
...
@@ -62,19 +62,6 @@ def lockCheckWrapper(func):
return
func
(
self
,
*
args
,
**
kw
)
return
wraps
(
func
)(
wrapper
)
class
OnTimeout
(
object
):
"""
Simple helper class for on_timeout parameter used in HandlerSwitcher
class.
"""
def
__init__
(
self
,
func
,
*
args
,
**
kw
):
self
.
func
=
func
self
.
args
=
args
self
.
kw
=
kw
def
__call__
(
self
,
conn
,
msg_id
):
return
self
.
func
(
conn
,
msg_id
,
*
self
.
args
,
**
self
.
kw
)
class
HandlerSwitcher
(
object
):
_next_timeout
=
None
_next_timeout_msg_id
=
None
...
...
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