Skip to content

Instantly share code, notes, and snippets.

@longfin
Created February 12, 2012 14:10
Show Gist options
  • Save longfin/1808724 to your computer and use it in GitHub Desktop.
Save longfin/1808724 to your computer and use it in GitHub Desktop.
after eventlet
import eventlet
eventlet.monkey_patch() #표준 라이브러리를 변환
# 여러가지 import를 하고...
pool = eventlet.GreenPool()
# 페이스북 계정들을 가져와서 반복하면서
for account in FacebookAccount.query:
# 코루틴들에게 떠넘기자.
pool.spawn_n(FacebookAccount.update, account)
pool.waitall()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment