An example blocking/non-blocking queue implementation in erlang