local record lib record queue size : integer count : function (queue) : integer enum push_errors "queue full" end push : function (queue, T) : boolean, push_errors pop : function (queue) : T peek : function (queue) : T replace : function (queue, T) : boolean, push_errors type iterator = function (T, integer) : integer, T items : function (queue) : iterator, T, integer type consume_iter = function (queue) : T consume : function (queue) : consume_iter end new : function (size:integer, allow_wrapping:boolean) : queue end return lib;