sonyxperiadev/pygerrit — pull request #19 by joerichter-stash (2014-03-25 09:15:59+00:00)
Title: fix for hanging connections

Hey David,

when i was trying to use your module, i noticed, that i could not use stop_stream_events() to stop reading events, because stream.py was waiting forever for a ssh-data.

Hope my patch is not too ugly and you could consider it for application.
regards, Joe

--
#start example code:

def main():
client = GerritClient("gerrit")
print client.gerrit_version()

client.start_event_stream()
try:
print "starting loop"
while True:
print "waiting for event"
event = client.get_event(block=True, timeout=1) #1sec

except:
print "received stop"
client.stop_event_stream()

#end example
--

--> Now interrupting with Ctrl-c