def turnstile_command(conf_file, command, arguments=[], channel=None,
                      debug=False):
    conf = config.Config(conf_file=conf_file)
    db = conf.get_database()
    control_channel = conf['control'].get('channel', 'control')
    command = command.lower()
    ts_conv = False
    if command == 'ping':
        if arguments:
            channel = arguments[0]
        else:
            channel = str(uuid.uuid4())
            arguments = [channel]
        if len(arguments) < 2:
            arguments.append(time.time())
            ts_conv = True
        arguments = arguments[:2]
    if debug:
        cmd = [command] + arguments
        print >>sys.stderr, ("Issuing command: %s" %
                             ' '.join(cmd))
    database.command(db, control_channel, command, *arguments)
    if not channel:
        return
    pubsub = db.pubsub()
    pubsub.subscribe(channel)
    try:
        count = 0
        for msg in pubsub.listen():
            if debug:
                formatted = pprint.pformat(msg)
                print >>sys.stderr, "Received message: %s" % formatted
            if (msg['type'] not in ('pmessage', 'message') or
                    msg['channel'] != channel):
                continue
            count += 1
            response = msg['data'].split(':')
            if ts_conv and response[0] == 'pong':
                try:
                    rtt = (time.time() - float(response[2])) * 100
                    response.append('(RTT %.2fms)' % rtt)
                except Exception:
                    pass
            print "Response % 5d: %s" % (count, ' '.join(response))
    except KeyboardInterrupt:
        pass