This allows the host (main host) to keep alive indefinitely so its actors
    can receive queries at any time.
    The main thread stays blocked forever.
    To kill the execution, press Ctrl+C.

    See usage example in :ref:`sample6`.

def serve_forever():
    '''
    This allows the host (main host) to keep alive indefinitely so its actors
    can receive queries at any time.
    The main thread stays blocked forever.
    To kill the execution, press Ctrl+C.

    See usage example in :ref:`sample6`.
    '''
    if not util.main_host.alive:
        raise Exception("This host is already shutted down.")
    util.main_host.serving = True
    signal.signal(SIGINT, signal_handler)
    print 'Press Ctrl+C to kill the execution'
    while util.main_host is not None and util.main_host.serving:
        try:
            sleep(1)
        except Exception:
            pass
    print 'BYE!'