Пример #1
0
    def setUp(self):
        env = 'greenhouse'
        Context, _ = get_zmq_classes(env)

        self.tools    = get_tools(env)
        self.context  = Context()
        self.executor = self.tools.Executor(24)
        self.client   = GreenRPCClient(context=self.context, green_env=env, executor=self.executor)
        self.service  = GreenRPCService(context=self.context, green_env=env, executor=self.executor)

        super(GreenhouseBase, self).setUp()
Пример #2
0
    def setUp(self):
        env = None
        Context, _ = get_zmq_classes(env)

        self.tools = get_tools(env)
        self.context = Context()
        self.executor = self.tools.Executor(12)
        self.client = SyncRPCClient(context=self.context)
        self.service = ThreadingRPCService(context=self.context, executor=self.executor)

        super(SyncBase, self).setUp()
Пример #3
0
    def setUp(self):
        env = None
        Context, _ = get_zmq_classes(env)

        self.tools    = get_tools(env)
        self.context  = Context()
        self.executor = self.tools.Executor(12)
        #from concurrent.futures import ThreadPoolExecutor
        #self.executor = ThreadPoolExecutor(12)
        self.client   = ThreadingRPCClient(context=self.context, executor=self.executor)
        self.service  = ThreadingRPCService(context=self.context, executor=self.executor)

        super(ThreadingBase, self).setUp()
Пример #4
0
# Copyright (c) 2015-2016 Contributors as noted in the AUTHORS file
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

green_backend = 'gevent'

if green_backend == 'eventlet':
    import eventlet as green
    from eventlet.green import zmq
elif green_backend == 'gevent':
    import gevent as green
    import zmq.green as zmq

from netcall import concurrency

_tools = concurrency.get_tools(env=green_backend)
Future = _tools.Future
Event = _tools.Event
Queue = _tools.Queue