Example #1
0
    def load(self, ctx):
        super(InternalPlugin, self).load(ctx)

        self.events = RedisSet(rdb, 'internal:tracked-events')
        self.session_id = None
        self.lock = Semaphore()
        self.cache = []
Example #2
0
    def test_basic_set(self):
        rdb.delete('TESTING:test-set')
        s1 = RedisSet(rdb, 'TESTING:test-set')
        s2 = RedisSet(rdb, 'TESTING:test-set')

        s1.add('1')
        s2.add('2')
        s1.add('3')
        s2.add('4')
        s1.add('4')
        s2.remove('4')
        s1.remove('3')
        s1.add('6')

        time.sleep(1)

        self.assertEquals(s1._set, s2._set)