This module provides thread-safe FIFO queues that can be accessed safely
by any number of threads.
Any data types supported by threads::shared can be passed via queues:
- Ordinary scalars
- Array refs
- Hash refs
- Scalar refs
- Objects based on the above
Ordinary scalars are added to queues as they are.
constant::defer creates a subroutine which on the first call runs given code to
calculate its value, and on any subsequent calls just returns that value, like a
constant. The value code is discarded once run, allowing it to be garbage
collected.
Deferring a calculation is good if it might take a lot of work or produce a big
result but is only needed sometimes or only well into a program run. If it's
never needed then the value code never runs.
A deferred constant is generally not inlined or folded (see "Constant Folding"
in perlop) since it's not a single scalar value. In the current implementation a
deferred constant becomes a plain constant after the first use, so may inline
etc in code compiled after that (see "IMPLEMENTATION" below).
Thrift::XS provides faster versions of Thrift::BinaryProtocol and
Thrift::MemoryBuffer.
Thrift compact protocol support is also available, just replace
Thrift::XS::BinaryProtocol with Thrift::XS::CompactProtocol.
To use, simply replace your Thrift initialization code with the appropriate
Thrift::XS version.
Perl interface to Thrift.
Throwable is a role for classes that are meant to be thrown as exceptions
to standard program flow. It is very simple and does only two things: saves
any previous value for $@ and calls die $self.
How many times have you written
sub { $obj->something($some, $args, @_) }
or worse still needed to weaken it and had to check and re-check your code to be
sure you weren't closing over things the wrong way?
Right. That's why I wrote this.
One of the drawbacks for using Perl's native array is that it is a
memory-hog. Normally it takes 20 bytes a scalar (16 bytes for scalar +
overhead). This can be a problem when you need to handle millions of
numbers in-memory. This module saves memory in exchange for speed.
Tie::DB_File::SplitHash
Designed for support of file size limited OSes. Transparently splits
a DB_File database into as many distinct files as desired. Distributes
hash entries between the files using a randomization algorithm.
Has the effect of allowing DB_File hashes to grow to the full size
of the partition. Requires 'Digest::SHA1' and 'DB_File' to be installed.
Tie::File::AsHash represents a regular text file as a Perl hash. Each key/value
pair in the hash corresponds to a record in the file.
Changes to the hash are reflected in the file immediately.
Tie::File represents a regular text file as a Perl array. Each element in
the array corresponds to a record in the file. The first line of the file
is element 0 of the array; the second line is element 1, and so on.
The file is not loaded into memory, so this will work even for gigantic files.
Changes to the array are reflected in the file immediately.