Commit 4dc29017 authored by Vincent Pelletier's avatar Vincent Pelletier

Make client handler classes inherit from EventHandler directly.

MasterHandler contains only server-side handlers.
parent 749c2bd1
......@@ -22,15 +22,11 @@ from neo.lib.protocol import NotReadyError, ProtocolError, \
UnexpectedPacketError
from neo.lib.protocol import BrokenNodeDisallowedError
from neo.lib.exception import ElectionFailure
from neo.lib.handler import EventHandler
from neo.lib.util import dump
from . import MasterHandler
class ClientElectionHandler(MasterHandler):
# FIXME: this packet is not allowed here, but handled in MasterHandler
# a global handler review is required.
def askPrimary(self, conn):
raise UnexpectedPacketError, "askPrimary on server connection"
class ClientElectionHandler(EventHandler):
def connectionFailed(self, conn):
addr = conn.getAddress()
......
......@@ -16,6 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
from . import MasterHandler
from neo.lib.handler import EventHandler
from neo.lib.exception import ElectionFailure, PrimaryFailure
from neo.lib.protocol import NodeTypes, Packets
......@@ -34,7 +35,7 @@ class SecondaryMasterHandler(MasterHandler):
def reelectPrimary(self, conn):
raise ElectionFailure, 'reelection requested'
class PrimaryHandler(MasterHandler):
class PrimaryHandler(EventHandler):
""" Handler used by secondaries to handle primary master"""
def connectionLost(self, conn, new_state):
......
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