Skip to content

Instantly share code, notes, and snippets.

@siddharthg
siddharthg / gist:6923b2cbb402bd65255af7859a5d52a5
Created December 21, 2017 07:29 — forked from timvlaer/gist:721ba30f8fc6a7aac1b0190e132a4261
Install Thrift 0.10.0 with brew on macOS
brew unlink thrift
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/16ebe5f1843e6cb54856311ff0f676be53007329/Formula/thrift.rb
@lars-tiede
lars-tiede / asyncio_loops.py
Last active April 3, 2024 15:28
asyncio + multithreading: one asyncio event loop per thread
import asyncio
import threading
import random
def thr(i):
# we need to create a new loop for the thread, and set it as the 'default'
# loop that will be returned by calls to asyncio.get_event_loop() from this
# thread.
loop = asyncio.new_event_loop()