def get_context():
    """Provide the context to use.

    This function takes care of creating new contexts in case of forks.
    """
    pid = os.getpid()
    if pid not in context:
        context[pid] = zmq.Context()
        logger.debug('renewed context for PID %d', pid)
    return context[pid]
Provide the context to use.

    This function takes care of creating new contexts in case of forks.