(queue, db_alias)
Pulls objects from queue and loads them into their DB.
Pulls objects from queue and loads them into their DB.
Pulls objects from queue and loads them into their DB .
def worker(queue, db_alias):
    """
    Pulls objects from queue and loads them into their DB.
    """
    coro = load_data_for_db(db_alias)
    next(coro)
    while True:
        obj = queue.get()
        if obj is None:
            load_stat = coro.send(None)
            queue.task_done()
            return load_stat
        coro.send(obj)
        queue.task_done()
def worker ( queue , db_alias ) : coro = load_data_for_db ( db_alias ) next ( coro ) while True : obj = queue . get ( ) if obj is None : load_stat = coro . send ( None ) queue . task_done ( ) return load_stat coro . send ( obj ) queue . task_done ( )