コード例 #1
0
ファイル: __init__.py プロジェクト: alanw/gevent-zeromq
def monkey_patch(test_suite=False):
    """
    Monkey patches `zmq.Context` and `zmq.Socket`
    
    If test_suite is True, the pyzmq test suite will be patched for
    compatibility as well.
    """
    ozmq = __import__('zmq')
    ozmq.Socket = zmq.Socket
    ozmq.Context = zmq.Context

    if test_suite:
        from gevent_zeromq.tests import monkey_patch_test_suite
        monkey_patch_test_suite()
コード例 #2
0
def monkey_patch(test_suite=False):
    """
    Monkey patches `zmq.Context` and `zmq.Socket`
    
    If test_suite is True, the pyzmq test suite will be patched for
    compatibility as well.
    """
    ozmq = __import__('zmq')
    ozmq.Socket = zmq.Socket
    ozmq.Context = zmq.Context

    if test_suite:
        from gevent_zeromq.tests import monkey_patch_test_suite
        monkey_patch_test_suite()
コード例 #3
0
ファイル: __init__.py プロジェクト: alessandrod/gevent-zeromq
def monkey_patch(test_suite=False):
    """
    Monkey patches `zmq.Context` and `zmq.Socket`

    If test_suite is True, the pyzmq test suite will be patched for
    compatibility as well.
    """
    ozmq = __import__('zmq')
    ozmq.Socket = zmq.Socket
    ozmq.Context = zmq.Context
    ozmq.Poller = zmq.Poller

    ioloop = __import__('zmq.eventloop.ioloop')
    ioloop.Poller = zmq.Poller

    global IOLOOP_IS_MONKEYPATCHED
    IOLOOP_IS_MONKEYPATCHED = True

    if test_suite:
        from gevent_zeromq.tests import monkey_patch_test_suite
        monkey_patch_test_suite()