Skip to content

Instantly share code, notes, and snippets.

View vrajivk's full-sized avatar

Rajiv Vijayakumar vrajivk

View GitHub Profile
@vrajivk
vrajivk / channel.py
Created May 5, 2015 22:10
Go style channels using PEP492 async/await
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):