Skip to content

Instantly share code, notes, and snippets.

@xodhx4
Created April 2, 2020 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xodhx4/73af9b6870fac8e6fc712e00c82dc425 to your computer and use it in GitHub Desktop.
Save xodhx4/73af9b6870fac8e6fc712e00c82dc425 to your computer and use it in GitHub Desktop.
Markdium-JS 초보가 쓰는 async await 처음부터 이해하기
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