Skip to content

Commit

Permalink
Added some documentation for the methods we have
Browse files Browse the repository at this point in the history
  • Loading branch information
KushalP committed Feb 16, 2014
1 parent 5498c62 commit 8958e48
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions serfclient/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,26 @@ def __init__(self, host='localhost', port=7373, timeout=3):
self.connection.handshake()

def event(self, name, payload, coalesce=True):
"""
Send an event to the cluster. Can take an optional payload as well,
which will be sent in the form that it's provided.
"""
return self.connection.call(
'event',
{'Name': name, 'Payload': payload, 'Coalesce': coalesce})

def force_leave(self, name):
"""
Force a node to leave the cluster.
"""
return self.connection.call(
'force-leave',
{"Node": name})

def join(self, location):
"""
Join another cluster by provided a list of ip:port locations.
"""
if not isinstance(location, (list, tuple)):
location = [location]
return self.connection.call(
Expand Down

0 comments on commit 8958e48

Please sign in to comment.