@defer.inlineCallbacks
def main():
    config = RedisForJasminConfig()
    rc = yield ConnectionWithConfiguration(config)
    print rc

    # Authenticate and select db
    if config.password is not None:
        rc.auth(config.password)
        rc.select(config.dbid)

    yield rc.set("foo", {'yes', 'no'})
    yield rc.expire("foo", 2)

    import time

    time.sleep(1)
    v = yield rc.get("foo")
    print "1, foo:", repr(v)

    time.sleep(1)
    v = yield rc.get("foo")
    print "2, foo:", repr(v)

    time.sleep(1)
    v = yield rc.get("foo")
    print "3, foo:", repr(v)

    msgid = "68ee8fe5-d5c8-4502-906a-c6b6b9fc2bed"
    v = yield rc.get(msgid)
    print "%s:" % msgid, repr(v)

    yield rc.disconnect()

# this only runs if the module was *not* imported
dataset/ETHPy150Open jookies/jasmin/jasmin/redis/client.py/main/original