Commit 70fb83f7 authored by Aurel's avatar Aurel

rename NEOStorage to Storage


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@158 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent ea1f2b70
...@@ -16,8 +16,8 @@ class NEOStorageConflictError(NEOStorageError): ...@@ -16,8 +16,8 @@ class NEOStorageConflictError(NEOStorageError):
class NEOStorageNotFoundError(NEOStorageError): class NEOStorageNotFoundError(NEOStorageError):
pass pass
class NEOStorage(BaseStorage.BaseStorage, class Storage(BaseStorage.BaseStorage,
ConflictResolution.ConflictResolvingStorage): ConflictResolution.ConflictResolvingStorage):
"""Wrapper class for neoclient.""" """Wrapper class for neoclient."""
__name__ = 'NEOStorage' __name__ = 'NEOStorage'
...@@ -53,7 +53,7 @@ class NEOStorage(BaseStorage.BaseStorage, ...@@ -53,7 +53,7 @@ class NEOStorage(BaseStorage.BaseStorage,
raise POSException.POSKeyError(oid) raise POSException.POSKeyError(oid)
def close(self): def close(self):
return self.appclose() return self.app.close()
def cleanup(self): def cleanup(self):
raise NotImplementedError raise NotImplementedError
......
from ZODB.config import BaseConfig from ZODB.config import BaseConfig
class NEOStorage(BaseConfig): class NeoStorage(BaseConfig):
def open(self): def open(self):
from NEOStorage import NEOStorage from Storage import Storage
return NEOStorage(master_nodes = self.config.master_nodes, name = self.config.name) return Storage(master_nodes = self.config.master_nodes, name = self.config.name)
<component prefix="neo.client.config"> <component prefix="neo.client.config">
<sectiontype name="NEOStorage" datatype=".NEOStorage" <sectiontype name="NeoStorage" datatype=".NeoStorage"
implements="ZODB.storage"> implements="ZODB.storage">
<description> <description>
A scalable storage for Zope A scalable storage for Zope
......
...@@ -16,6 +16,12 @@ class BaseConnection(object): ...@@ -16,6 +16,12 @@ class BaseConnection(object):
if s is not None: if s is not None:
event_manager.register(self) event_manager.register(self)
def lock(self):
return 1
def unlock(self):
return None
def getSocket(self): def getSocket(self):
return self.s return self.s
...@@ -47,12 +53,6 @@ class BaseConnection(object): ...@@ -47,12 +53,6 @@ class BaseConnection(object):
def getUUID(self): def getUUID(self):
return None return None
def acquire(self, block = 1):
return 1
def release(self):
pass
class ListeningConnection(BaseConnection): class ListeningConnection(BaseConnection):
"""A listen connection.""" """A listen connection."""
def __init__(self, event_manager, handler, addr = None, **kw): def __init__(self, event_manager, handler, addr = None, **kw):
...@@ -246,7 +246,7 @@ class Connection(BaseConnection): ...@@ -246,7 +246,7 @@ class Connection(BaseConnection):
def expectMessage(self, msg_id = None, timeout = 5, additional_timeout = 30): def expectMessage(self, msg_id = None, timeout = 5, additional_timeout = 30):
"""Expect a message for a reply to a given message ID or any message. """Expect a message for a reply to a given message ID or any message.
The purpose of this method is to define how much amount of time is The purpose of this method is to define how much amount of time is
acceptable to wait for a message, thus to detect a down or broken acceptable to wait for a message, thus to detect a down or broken
peer. This is important, because one error may halt a whole cluster peer. This is important, because one error may halt a whole cluster
...@@ -257,10 +257,10 @@ class Connection(BaseConnection): ...@@ -257,10 +257,10 @@ class Connection(BaseConnection):
The message ID specifies what ID is expected. Usually, this should The message ID specifies what ID is expected. Usually, this should
be identical with an ID for a request message. If it is None, any be identical with an ID for a request message. If it is None, any
message is acceptable, so it can be used to check idle time. message is acceptable, so it can be used to check idle time.
The timeout is the amount of time to wait until keep-alive messages start. The timeout is the amount of time to wait until keep-alive messages start.
Once the timeout is expired, the connection starts to ping the peer. Once the timeout is expired, the connection starts to ping the peer.
The additional timeout defines the amount of time after the timeout The additional timeout defines the amount of time after the timeout
to invoke a timeoutExpired callback. If it is zero, no ping is sent, and to invoke a timeoutExpired callback. If it is zero, no ping is sent, and
the callback is executed immediately.""" the callback is executed immediately."""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment