@fotosyfondos · Post #9728 · 23.11.2018 г., 16:39
📸🖼📸🖼📸🖼📸🖼📸🖼📸🖼 ➡️ Fantasmas #Fantasmas#Terror#Luigi#FondosDePantalla @fotosyfondos 📸🖼📸🖼📸🖼📸🖼📸🖼📸🖼
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #400 · 8 дек.
Три способа выполнить множество задач с asyncio Функция для примера: async def do_it(n): await asyncio.sleep(random.uniform(0.5, 1)) return n 1. Последовательный вызов async def main(): for i in range(100): result = await do_it(i) Такой вызов имеет смысл только тогда, когда результат одной задачи требуется для вызова следующей. Если они независимы, то это антипаттерн, так как аналогичен простому синхронному вызову по очереди. 2. Упорядоченный результат async def main(): tasks = [do_it(i) for i in range(100)] results = await asyncio.gather(*tasks) Выполняет корутины конкурентно и возвращает результат в виде списка. Полезен когда требуется получить результаты в том же порядке в котором задачи отправлены. 3. Результат по мере готовности tasks = [asyncio.create_task(do_it(i)) for i in range(100)] for cor in asyncio.as_completed(tasks): result = await cor Так же выполняет корутины конкурентно, но не гарантирует порядок. Результат возвращается по мере готовности, каждый отдельно. Полезен когда нужно обработать любой ответ как можно скорее. #async
Hashtags
Пребарај: #luigi
@fotosyfondos · Post #9728 · 23.11.2018 г., 16:39
📸🖼📸🖼📸🖼📸🖼📸🖼📸🖼 ➡️ Fantasmas #Fantasmas#Terror#Luigi#FondosDePantalla @fotosyfondos 📸🖼📸🖼📸🖼📸🖼📸🖼📸🖼
@djangoproject · Post #275 · 18.03.2017 г., 01:51
https://github.com/spotify/luigi Writing batch jobs is generally only one part of processing heaps of data; you also have to string all the jobs together into something resembling a #workflow or a #pipeline. #Luigi, created by Spotify and named for the other plucky plumber made famous by Nintendo, was built to "address all the plumbing typically associated with long-running batch processes." With Luigi, a developer can take several different unrelated data processing tasks — "a Hive query, a Hadoop job in Java, a Spark job in Scala, dumping a table from a database" — and create a workflow that runs them, end to end. The entire description of a job and its dependencies are created as Python modules, not as XML config files or another data format, so it can be integrated into other Python-centric projects. #Machine_learning