NAME

Thread::Queue::MaxSize - Thread-safe queues with an upper bound

VERSION

This document describes Thread::Queue::MaxSize version 1.0.0

SYNOPSIS

use strict;
use warnings;

use threads;
use Thread::Queue::MaxSize;

# create a new empty queue with no max limit
my $q = Thread::Queue::MaxSize->new();

# create a new empty queue that will only ever store 1000 entries
my $q = Thread::Queue::MaxSize->new({ maxsize => 1000 });

# create a new empty queue with no max limit and some default values
my $q = Thread::Queue::MaxSize->new({}, $foo, $bar, @qwerty);

# create a new empty queue with some default values that will only ever
# store 1000 entries
my $q = Thread::Queue::MaxSize->new({ maxsize => 1000 }, $foo, $bar, @qwerty);

DESCRIPTION

This is a variation on Thread::Queue that will enforce an upper bound on the number of entries that can be enqueued. This can be used to prevent memory use from exploding on a queue that might never empty.

If new entries are added to the queue that cause the queue to exceed the configured size, the oldest entries will be dropped off the end. This may cause your program to miss some entries on the queue but that's how it works.

SEE ALSO

Thread::Queue, threads, threads::shared

MAINTAINER

Paul Lockaby <plockaby AT cpan DOT org>

CREDIT

Large huge portions of this module are directly from Thread::Queue which is maintained by Jerry D. Hedden.

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.