Created
April 2, 2020 11:29
-
-
Save xodhx4/73af9b6870fac8e6fc712e00c82dc425 to your computer and use it in GitHub Desktop.
Markdium-JS 초보가 쓰는 async await 처음부터 이해하기
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from concurrent.futures import * | |
with ThreadPoolExecutor(max_workers=1) as excutor: | |
future = excutor.submit(open, "example.txt", "r") // example.txt를 다 읽을 때 까지 기다리지 않고 Future 객체를 돌려준다 : Non-Blocking IO | |
f = future.result() // future에게 example.txt 의 파일 객체를 달라고 요청한다. example.txt를 다 읽을 때 까지 기다린다 : Blocking IO | |
print(f.readline()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment