This module adds cancellation capabilities for threads. Cancelled threads are
terminated using threads->exit(). The thread is then detached, and hence
automatically cleaned up.
Threads that are suspended using Thread::Suspend do not need to be resumed in
order to be cancelled.
It is possible for a thread to cancel itself.
This module defines a set of symbolic constants with ordered numeric
values ala C enum types.
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.
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.
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.
Compile-time interface complaince testing. Inspects the methods defined in your
module, and compares them against the methods defined in the modules you list.
Requires no special or additional syntax.
Use the latest Perl features