Exemple #1
0
def iter_messages_pubsub(channels, prefix="channel", timeout=1):
    pub = db.pubsub()
    if channels:
        pub.subscribe(["%s:%s" (prefix, channel) for channel in channels])
    else:
        pub.psubscribe(["%s:*" % (prefix)])
    while True:
        yield get_message_pubsub(pub, timeout=timeout)
Exemple #2
0
def iter_messages_pubsub(channels, prefix="channel", timeout=1):
    pub = db.pubsub()
    if channels:
        pub.subscribe(["%s:%s" (prefix, channel) for channel in channels])
    else:
        pub.psubscribe(["%s:*" % (prefix)])
    while True:
        yield get_message_pubsub(pub, timeout=timeout)
Exemple #3
0
def iter_status():
    pub = db.pubsub()
    pub.subscribe(["queues:status"])
    yield get_status()
    while True:
        channel = get_message_pubsub(pub)
        if channel is not None:
            yield get_status(channel)
        else:
            yield
Exemple #4
0
def iter_status():
    pub = db.pubsub()
    pub.subscribe(["queues:status"])
    yield get_status()
    while True:
        channel = get_message_pubsub(pub)
        if channel is not None:
            yield get_status(channel)
        else:
            yield