Skip to content

Commit 4921a8e

Browse files
committed
Merge pull request #38 from mwhooker/master
implement WAIT command.
2 parents dc0f808 + 17d3562 commit 4921a8e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

server.py

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def mangodb(socket, address):
1212
client = socket.makefile()
1313
output = open(os.devnull, 'w')
1414
lock = threading.Lock()
15+
wait = threading.Condition(lock)
1516
while 1:
1617
line = client.readline()
1718
if not line:
@@ -20,6 +21,9 @@ def mangodb(socket, address):
2021
cmd = cmd_bits[0]
2122
if cmd == 'BYE':
2223
break
24+
if cmd == 'WAIT':
25+
wait.wait()
26+
continue
2327
if len(cmd_bits) > 1:
2428
lock.acquire(True)
2529
output.write(cmd_bits[1])

0 commit comments

Comments
 (0)