exchange: introduce a wireprotocol command to push markers
Pushkey is not adapted to transmit a stream of binary data. We used it as a hack
so far. We add a new wire protocol command to speed the things up (and also push
all the markers in a single transaction). The proper way to do it is to
introduce bundle2 in core, but this will already help in the mean time.
#!/usr/bin/env python
import os, time, errno, signal
# Kill off any leftover daemon processes
try:
fp = open(os.environ['DAEMON_PIDS'])
for line in fp:
try:
pid = int(line)
except ValueError:
continue
try:
os.kill(pid, 0)
os.kill(pid, signal.SIGTERM)
for i in range(10):
time.sleep(0.05)
os.kill(pid, 0)
os.kill(pid, signal.SIGKILL)
except OSError, err:
if err.errno != errno.ESRCH:
raise
fp.close()
except IOError:
pass