Skip to content

Instantly share code, notes, and snippets.

Avatar

Rajiv Vijayakumar vrajivk

View GitHub Profile
@vrajivk
vrajivk / channel.py
Created May 5, 2015
Go style channels using PEP492 async/await
View channel.py
from collections import deque, namedtuple
import types
class Channel:
def __init__(self, name='', size=1):
self.deque = deque(maxlen=size)
self.name = name
@types.coroutine
def transmit(self, message):