fulltext/factory.py
def wait_for(service: IAwaitable, delay: int = 2, **extra: Any) -> None:
    """Wait for a service to become available."""
    if hasattr(service, '__name__'):
        service_name = service.__name__    # type: ignore
    elif hasattr(service, '__class__'):
        service_name = service.__class__.__name__
    else:
        service_name = str(service)

    logger.info('await %s', service_name)
    while not service.is_available(**extra):
        logger.info('service %s is not available; try again', service_name)
        time.sleep(delay)
    logger.info('service %s is available!', service_name)
Wait for a service to become available.
Wait for a service to become available.
Wait for a service to become available .
def wait_for(service: IAwaitable, delay: int = 2, **extra: Any) -> None:
    if hasattr(service, '__name__'):
        service_name = service.__name__    
    elif hasattr(service, '__class__'):
        service_name = service.__class__.__name__
    else:
        service_name = str(service)
    logger.info('await %s', service_name)
    while not service.is_available(**extra):
        logger.info('service %s is not available; try again', service_name)
        time.sleep(delay)
    logger.info('service %s is available!', service_name)
def wait_for ( service : IAwaitable , delay : int = 2 , ** extra : Any ) -> None : if hasattr ( service , '__name__' ) : service_name = service . __name__ elif hasattr ( service , '__class__' ) : service_name = service . __class__ . __name__ else : service_name = str ( service ) logger . info ( 'await %s' , service_name ) while not service . is_available ( ** extra ) : logger . info ( 'service %s is not available; try again' , service_name ) time . sleep ( delay ) logger . info ( 'service %s is available!' , service_name )
Wait for a service to become available.
Wait for a service to become available .
"""Wait for a service to become available.""" # type: ignore
service
IAwaitable
delay
int
extra
Any