|
|
| |
App::PFM::Job::Abstract(3) |
User Contributed Perl Documentation |
App::PFM::Job::Abstract(3) |
Abstract PFM Job class for defining a common interface to Jobs.
- _init(hashref { $eventname1 => coderef
$handler1 [, ...] } [, hashref $options ]
)
- Initializes the 'running' flag ('childpid'), and registers the provided
event handlers.
- _catch_child()
- Cleans up finished child processes.
perlvar(1) warns us that: "If you have installed a
signal handler for SIGCHLD, the value of $? will
usually be wrong outside that handler." Therefore, the child's exit
code is fetched and propagated via
$App::PFM::Application::CHILD_ERROR.
- _start_child()
- Stub routine for starting the actual job.
- _stop_child()
- Routine for stopping the job. Send TERM, INT and QUIT signals. Returns
whether the job was stopped correctly.
- _poll_data()
- Checks if there is data available on the pipe, and if so, reads it and
sends it to the preprocessor. If the preprocessor returns a defined value,
The output is accumulated in the poll buffer.
Returns a true value if the job is still running, false if it
has finished.
- _preprocess(string $data)
- Stub routine for preprocessing job output. This routine is used for
"massaging" the command output into a common format that can be
used by the callback routine.
- isapplicable()
- Stub routine for telling if the job is applicable. The job may not be
applicable if e.g. the current directory does not belong to the type of
RCS repository handled by the job.
- start()
- Fires the before_job_start event. If this returns true, it sets the
'running' flag, opens a pipe, starts the job and fires the
after_job_start event.
Note that if no handler has been registered, the fire()
method will return 0 but true.
- poll()
- Calls _poll_data() to accumulate job data into a poll buffer. When
done and if data is available, the after_job_receive_data event is
fired.
- stop()
- Resets the 'running' flag, stops the job, closes the pipe and fires the
after_job_finish event.
This package implements the following events:
- before_job_start
- Called before starting the job. If the handler returns false, starting the
job is aborted.
- after_job_start
- Called when the job has started.
- after_job_receive_data
- Called when data has been received from the job.
- after_job_finish
- Called when the job has finished.
pfm(1), App::PFM::JobHandler(3pm).
Visit the GSP FreeBSD Man Page Interface. Output converted with ManDoc. |