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
Xavier Thompson
neoppod
Commits
4dc29017
Commit
4dc29017
authored
Feb 28, 2012
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make client handler classes inherit from EventHandler directly.
MasterHandler contains only server-side handlers.
parent
749c2bd1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
7 deletions
+4
-7
neo/master/handlers/election.py
neo/master/handlers/election.py
+2
-6
neo/master/handlers/secondary.py
neo/master/handlers/secondary.py
+2
-1
No files found.
neo/master/handlers/election.py
View file @
4dc29017
...
...
@@ -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
()
...
...
neo/master/handlers/secondary.py
View file @
4dc29017
...
...
@@ -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
(
Master
Handler
):
class
PrimaryHandler
(
Event
Handler
):
""" Handler used by secondaries to handle primary master"""
def
connectionLost
(
self
,
conn
,
new_state
):
...
...
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