Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(50)  |  Call(46)  |  Derive(2)  |  Import(2)

src/b/l/bluepass-HEAD/bluepass/syncapi.py   bluepass(Download)
 
import gruvi
from gruvi import Fiber, compat
from gruvi.http import HttpServer, HttpClient
 
class SyncAPIPublisher(Fiber):
    """Sync API publisher.
 
    The Publisher is responsible for publising the location of our syncapi
    via the Locator, and keeping these published locations up to date.

src/g/r/gruvi-HEAD/tests/test_fibers.py   gruvi(Download)
                done.emit()
        for i in range(1000):
            gr = gruvi.Fiber(worker)
            gr.start()
        done.wait()
            result.extend(args)
            return True
        gr1 = gruvi.Fiber(target1, args=('a', 'b'))
        gr1.start()
        gr2 = gruvi.Fiber(target2, args=('c', 'd'))
    def test_log_exception(self):
        hub = gruvi.get_hub()
        def target():
            raise ValueError
        gr1 = gruvi.Fiber(target)

src/g/r/gruvi-0.9.2/tests/test_fibers.py   gruvi(Download)
                done.emit()
        for i in range(1000):
            gr = gruvi.Fiber(worker)
            gr.start()
        done.wait()
            result.extend(args)
            return True
        gr1 = gruvi.Fiber(target1, args=('a', 'b'))
        gr1.start()
        gr2 = gruvi.Fiber(target2, args=('c', 'd'))
    def test_log_exception(self):
        hub = gruvi.get_hub()
        def target():
            raise ValueError
        gr1 = gruvi.Fiber(target)

src/b/l/bluepass-HEAD/bluepass/syncer.py   bluepass(Download)
 
import gruvi
from gruvi import Fiber
 
from bluepass import logging
class Syncer(Fiber):
    """Syncer.
 
    The syncer is an component that is responsible for inbound/outbound
    synchronization. The sync jobs are run either periodically, or based on

src/g/r/gruvi-0.9.2/tests/test_sync.py   gruvi(Download)
        fibers = []
        for i in range(20):
            fiber = gruvi.Fiber(run_test)
            fiber.start()
            fibers.append(fiber)
        fibers = []
        for i in range(20):
            fiber = gruvi.Fiber(run_test)
            fiber.start()
            fibers.append(fiber)
        def run_thread():
            fibers = []
            for i in range(10):
                fiber = gruvi.Fiber(run_test)
                fiber.start()
        def run_thread():
            fibers = []
            for i in range(5):
                fiber = gruvi.Fiber(run_test)
                fiber.start()
            gruvi.sleep(0.01)
            queue.put(value)
        fib = gruvi.Fiber(put_queue, ('foo',))
        fib.start()
        self.assertEqual(queue.get(), 'foo')

src/g/r/gruvi-HEAD/tests/test_sync.py   gruvi(Download)
        fibers = []
        for i in range(20):
            fiber = gruvi.Fiber(run_test)
            fiber.start()
            fibers.append(fiber)
        fibers = []
        for i in range(20):
            fiber = gruvi.Fiber(run_test)
            fiber.start()
            fibers.append(fiber)
        def run_thread():
            fibers = []
            for i in range(10):
                fiber = gruvi.Fiber(run_test)
                fiber.start()
        def run_thread():
            fibers = []
            for i in range(5):
                fiber = gruvi.Fiber(run_test)
                fiber.start()
            gruvi.sleep(0.01)
            queue.put(value)
        fib = gruvi.Fiber(put_queue, ('foo',))
        fib.start()
        self.assertEqual(queue.get(), 'foo')

src/g/r/gruvi-0.9.2/tests/test_local.py   gruvi(Download)
            util.sleep(0)
            self.assertEqual(local.foo, 40)
        gr1 = gruvi.Fiber(fiber1)
        gr2 = gruvi.Fiber(fiber2)
        gr1.start()
        def fiber1():
            local.foo = 10
        gr1 = gruvi.Fiber(fiber1)
        gr1.start()
        gr1.done.wait()

src/g/r/gruvi-HEAD/tests/test_local.py   gruvi(Download)
            util.sleep(0)
            self.assertEqual(local.foo, 40)
        gr1 = gruvi.Fiber(fiber1)
        gr2 = gruvi.Fiber(fiber2)
        gr1.start()
        def fiber1():
            local.foo = 10
        gr1 = gruvi.Fiber(fiber1)
        gr1.start()
        gr1.done.wait()

src/g/r/gruvi-0.9.2/tests/test_futures.py   gruvi(Download)
            gruvi.sleep(0.1)
            fut.set_result('foo')
        fib = gruvi.Fiber(set_result)
        fib.start()
        fut.done.wait()
            gruvi.sleep(0.1)
            fut.set_result('foo')
        fib = gruvi.Fiber(set_result)
        fib.start()
        self.assertEqual(fut.result(), 'foo')

src/g/r/gruvi-HEAD/tests/test_futures.py   gruvi(Download)
            gruvi.sleep(0.1)
            fut.set_result('foo')
        fib = gruvi.Fiber(set_result)
        fib.start()
        fut.done.wait()
            gruvi.sleep(0.1)
            fut.set_result('foo')
        fib = gruvi.Fiber(set_result)
        fib.start()
        self.assertEqual(fut.result(), 'foo')