K. Lottz > Su > Su::Process

Download:
Su-0.110.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Source  

NAME ^

Su::Process - A module to generate and execute user process.

SYNOPSIS ^

use Su::Process;

# Generate the Process file.

 generate_proc('pkg/SomeProc');

# Execute the Process and get it's result.

 $ret = gen("pkg/SomeProc");
 $ret = comp("pkg/SomeProc");

DESCRIPTION ^

Su::Process has a method to generate the template of the Process module to describe user process. These Processes are called from the method Su::resolve. The user Processes are also called directry by the method Su::Process::gen. The method Su::Process::comp is an alias of the method Su::Process::gen for embed to the template like a component.

ATTRIBUTES ^

$SUPRESS_LOAD_ERROR

For suppress the load error because of the specified module file is not found.

 $Su::Process::SUPPRESS_LOAD_ERROR = 1;

FUNCTIONS ^

new()

A Constructor.

generate_process()

This function is just a synonym of the method generate_proc.

generate_proc()

Generate the Process file to describe your own code in the method 'process'. This method can be used from the command line like the following.

 perl -MSu::Process -e '{generate_proc("MainProc")}'

If generation is success, this subroutine return the generated file name, else should die or return undef.

comp()

This method is just a alias of gen metnod.

gen()
 my $ret = gen('process_id');
 my $ret = gen('dir/process_id');
 my $ret = gen('dir::process_id');

Return the result of the process which coressponds to the passed process id. The process id is a qualified module name. Note that the specified process is simply called it's process method and can't access to it's model field.

load_module()
 my $su_proc = Su::Process->new;
 my $proc_module = $su_proc->load_module($module_name);
syntax highlighting: