Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Toy in-memory queue server using Facebook's Thrift protocol/RPC generator

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 src
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README
README
simple-thrift-queue
===================
  Phillip Pearson
  http://www.myelin.co.nz/post/2008/8/4/#200808043

This is a toy in-memory (very much non-durable) queue, with a client
and server in Python and a server in C++ -- the results of an
evening's hacking with Facebook's Thrift protocol/RPC generator.

On my laptop it handles about 4000 RPCs per second, i.e. if you have
one producer and three consumers, the producer can push about 2000
messages per second, which are fairly evenly spread across the
consumers.

The throughput is almost identical with the C++ server.  'top' reports
~80% system time and 'iftop' reports ~300kB/s traffic.  

Requirements
============

- Thrift
- Python

Building and running
====================

cd src
make
python py/server.py
python py/timer.py
python py/consumer.py
python py/producer.py

Try starting the server and a few consumers, then a producer.

C++ server
===========

cd src/cpp
make run
Something went wrong with that request. Please try again.