Skip to content

Commit

Permalink
Merge pull request #38 from mwhooker/master
Browse files Browse the repository at this point in the history
implement WAIT command.
  • Loading branch information
dcramer committed Dec 11, 2013
2 parents dc0f808 + 17d3562 commit 4921a8e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server.py
Expand Up @@ -12,6 +12,7 @@ def mangodb(socket, address):
client = socket.makefile()
output = open(os.devnull, 'w')
lock = threading.Lock()
wait = threading.Condition(lock)
while 1:
line = client.readline()
if not line:
Expand All @@ -20,6 +21,9 @@ def mangodb(socket, address):
cmd = cmd_bits[0]
if cmd == 'BYE':
break
if cmd == 'WAIT':
wait.wait()
continue
if len(cmd_bits) > 1:
lock.acquire(True)
output.write(cmd_bits[1])
Expand Down

1 comment on commit 4921a8e

@thetylerhayes
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get after it cramer

Please sign in to comment.