Did I find the right examples for you? yes no

All Samples(3)  |  Call(0)  |  Derive(0)  |  Import(3)
Iter each changes and pass it to the callable

        def foreach(db, fun, since=0):
    """Iter each changes and pass it to the callable"""

    if not callable(fun):
        raise TypeError("fun isn't a callable")

    with ChangesStream(db, since=since) as st:
        for c in st:
            fun(c)
        


src/c/o/couchdbkit-HEAD/tests/test_changes.py   couchdbkit(Download)
 
from couchdbkit import *
from couchdbkit.changes import ChangesStream, fold, foreach
 
class ClientServerTestCase(unittest.TestCase):

src/j/s/jsonobject-couchdbkit-0.6.5.5/tests/test_changes.py   jsonobject-couchdbkit(Download)
 
from couchdbkit import *
from couchdbkit.changes import ChangesStream, fold, foreach
 
class ClientServerTestCase(unittest.TestCase):

src/c/o/couchdbkit-0.6.5/tests/test_changes.py   couchdbkit(Download)
 
from couchdbkit import *
from couchdbkit.changes import ChangesStream, fold, foreach
 
class ClientServerTestCase(unittest.TestCase):