1Object::Remote::Role::CUosnenrecCOtobonjrte:rc:itPb:eu:rtRleeIdmnotPteeerr:pl:rReDotoleceru:(m:3eC)notnanteicotnor::PerlInterpreter(3)
2
3
4

NAME

6       Object::Remote::Role::Connector::PerlInterpreter - Role for connections
7       to a Perl interpreter
8

SYNOPSIS

10         use Object::Remote;
11
12         my %opts = (
13           perl_command => [qw(nice -n 10 perl -)],
14           watchdog_timeout => 120, stderr => \*STDERR,
15         );
16
17         my $local_connection = Object::Remote->connect('-', %opts);
18         my $hostname = Sys::Hostname->can::on($remote, 'hostname');
19

DESCRIPTION

21       This is the role that supports connections to a Perl interpreter that
22       is executed in a different process. The new Perl interpreter can be
23       either on the local or a remote machine and is configurable via
24       arguments passed to the constructor.
25

ARGUMENTS

27       perl_command
28           By default the Perl interpeter will be executed as "perl -" but
29           this can be changed by providing an array reference as the value to
30           the perl_command attribute during construction.
31
32       stderr
33           If this value is defined then it will be used as the file handle
34           that receives the output of STDERR from the Perl interpreter
35           process and I/O will be performed by the run loop in a non-blocking
36           way. If the value is undefined then STDERR of the remote process
37           will be connected directly to STDERR of the local process with out
38           the run loop managing I/O. The default value is undefined.
39
40           There are a few ways to use this feature. By default the behavior
41           is to form one unified STDERR across all of the Perl interpreters
42           including the local one. For small scale and quick operation this
43           offers a predictable and easy to use way to get at error messages
44           generated anywhere. If the local Perl interpreter crashes then the
45           remote Perl interpreters still have an active STDERR and it is
46           possible to still receive output from them. This is generally a
47           good thing but can cause issues.
48
49           When using a file handle as the output for STDERR once the local
50           Perl interpreter is no longer running there is no longer a valid
51           STDERR for the remote interpreters to send data to. This means that
52           it is no longer possible to receive error output from the remote
53           interpreters and that the shell will start to kill off the child
54           processes. Passing a reference to STDERR for the local interpreter
55           (as the SYNOPSIS shows) causes the run loop to manage I/O, one
56           unified STDERR for all Perl interpreters that ends as soon as the
57           local interpreter process does, and the shell will start killing
58           children when the local interpreter exits.
59
60           It is also possible to pass in a file handle that has been opened
61           for writing. This would be useful for logging the output of the
62           remote interpreter directly into a dedicated file.
63
64       watchdog_timeout
65           If this value is defined then it will be used as the number of
66           seconds the watchdog will wait for an update before it terminates
67           the Perl interpreter process. The default value is undefined and
68           will not use the watchdog. See "Object::Remote::Watchdog" for more
69           information.
70

SEE ALSO

72       "Object::Remote"
73
74
75
76perl v5.36.0               Object:2:0R2e3m-o0t1e-:2:0Role::Connector::PerlInterpreter(3)
Impressum