Skip to content

Instantly share code, notes, and snippets.

@staltz
staltz / introrx.md
Last active April 19, 2025 05:15
The introduction to Reactive Programming you've been missing
@sznurek
sznurek / coroutine.py
Created February 19, 2014 22:37
Python asynchronous server featuring generator (coroutines).
#!/usr/bin/env python3
import sys
import socket
import select
def command(name, args=None):
return {'name': name, 'args': args}
def readcmd():
@tmc
tmc / gist:777085
Created January 12, 2011 23:08
multiprocessing gevent chat example
import sys
import gevent
from gevent.monkey import patch_all; patch_all()
from gevent import server, event, socket
from multiprocessing import Process, current_process, cpu_count
"""
Simple multiprocess StreamServer that proxies messages between clients.
Avoids using a multiprocessing.Event since it blocks on a semaphore.