NAME
Term::YAP::iThread - subclass of Term::YAP implemented with ithreads
SYNOPSIS
See parent class.
DESCRIPTION
Subclass of Term::YAP implemented with ithreads. The pun with it's name is intended.
Despite the limitation of http://perldoc.perl.org/threads.html#WARNING|'ithreads' some platforms (like Microsoft Windows) does not work well with process handling of Perl. If you in this case, this implementation of Term::YAP might help you.
If you program code does not handle ithreads
correctly, consider initiation a Term::YAP::iThread object in a BEGIN
block to avoid loading the code that does not support ithreads
.
ATTRIBUTES
Additionally to all attributes from superclass, this class also has the queue
attribute.
queue
Keeps a reference of a Thread::Queue instance. This instance is created automatically during Term::YAP::iThread creation.
detach
A "private" attribute. Used to control when the created thread is expected to exists it's infinite loop after start_pulse
method invocation.
METHODS
The following methods are overriden from parent class:
- start
- stop
get_queue
Getter for the queue
attribute.
BUILD
Creates a thread right after object instantiation.
The thread will start only after start
method is called.
DEMOLISH
This method will take care to "terminated" the Thread::Queue object used to provide communication with the thread.
CAVEATS
To enable usage of this module with code that does not supports threads, this class will create a detached thread as soon as the object was created. This thread will remain active until the end of the program, waiting to receive a command to start the pulse (or stop it).
That said, the class will not try to create new threads and will not check if the created thread exited successfully (but it does check if the thread is retrieving items from the Thread::Queue object created).
SEE ALSO
AUTHOR
Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>
Term::Pulse was originally created by Yen-Liang Chen, <alec at cpan.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2015 of Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>
This file is part of Term-YAP distribution.
Term-YAP is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Term-YAP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Term-YAP. If not, see <http://www.gnu.org/licenses/>.