File: zproc.api

package info (click to toggle)
czmq 4.2.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,912 kB
  • sloc: ansic: 30,811; cpp: 19,362; sh: 11,873; python: 11,814; pascal: 11,229; ruby: 8,818; java: 4,363; makefile: 299; perl: 151; javascript: 35
file content (133 lines) | stat: -rw-r--r-- 4,546 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<class name = "zproc" state = "draft">
    <!--
    Copyright (c) the Contributors as noted in the AUTHORS file.
    This file is part of CZMQ, the high-level C binding for 0MQ:
    http://czmq.zeromq.org.

    This Source Code Form is subject to the terms of the Mozilla Public
    License, v. 2.0. If a copy of the MPL was not distributed with this
    file, You can obtain one at http://mozilla.org/MPL/2.0/.
    -->
    process configuration and status

    <constructor>
        Create a new zproc.
        NOTE: On Windows and with libzmq3 and libzmq2 this function
        returns NULL. Code needs to be ported there.
    </constructor>

    <destructor>
        Destroy zproc, wait until process ends.
    </destructor>

    <method name = "args" >
        Return command line arguments (the first item is the executable) or
        NULL if not set.
        <return type = "zlist" fresh = "1" />
    </method>

    <method name = "set args" >
        Setup the command line arguments, the first item must be an (absolute) filename
        to run.
        <argument name = "arguments" type = "zlist" by_reference = "1" />
    </method>

    <method name = "set argsx" >
        Setup the command line arguments, the first item must be an (absolute) filename
        to run. Variadic function, must be NULL terminated.
        <argument name = "arguments" type = "string" variadic = "1" />
    </method>

    <method name = "set env" >
        Setup the environment variables for the process.
        <argument name = "arguments" type = "zhash" by_reference = "1" />
    </method>

    <method name = "set stdin" >
        Connects process stdin with a readable ('>', connect) zeromq socket. If
        socket argument is NULL, zproc creates own managed pair of inproc
        sockets.  The writable one is then accessbile via zproc_stdin method.
        <argument name = "socket" type = "anything" />
    </method>

    <method name = "set stdout" >
        Connects process stdout with a writable ('@', bind) zeromq socket. If
        socket argument is NULL, zproc creates own managed pair of inproc
        sockets.  The readable one is then accessbile via zproc_stdout method.
        <argument name = "socket" type = "anything" />
    </method>

    <method name = "set stderr" >
        Connects process stderr with a writable ('@', bind) zeromq socket. If
        socket argument is NULL, zproc creates own managed pair of inproc
        sockets.  The readable one is then accessbile via zproc_stderr method.
        <argument name = "socket" type = "anything" />
    </method>

    <method name = "stdin">
        Return subprocess stdin writable socket. NULL for
        not initialized or external sockets.
        <return type="anything" />
    </method>

    <method name = "stdout">
        Return subprocess stdout readable socket. NULL for
        not initialized or external sockets.
        <return type="anything" />
    </method>

    <method name = "stderr">
        Return subprocess stderr readable socket. NULL for
        not initialized or external sockets.
        <return type="anything" />
    </method>

    <method name = "run" >
        Starts the process, return just before execve/CreateProcess.
        <return type = "integer" />
    </method>

    <method name = "returncode">
        process exit code
        <return type="integer" />
    </method>

    <method name = "pid">
        PID of the process
        <return type="integer" />
    </method>

    <method name = "running">
        return true if process is running, false if not yet started or finished
        <return type="boolean" />
    </method>

    <method name = "wait">
        The timeout should be zero or greater, or -1 to wait indefinitely.
        wait or poll process status, return return code
        <argument name = "timeout" type = "integer" />
        <return type="integer" />
    </method>

    <method name = "shutdown">
        send SIGTERM signal to the subprocess, wait for grace period and
        eventually send SIGKILL
        <argument name = "timeout" type = "integer" />
    </method>

    <method name = "actor">
        return internal actor, useful for the polling if process died
        <return type="anything" />
    </method>

    <method name = "kill">
        send a signal to the subprocess
        <argument name = "signal" type = "integer" />
    </method>

    <method name = "set verbose">
        set verbose mode
        <argument name = "verbose" type = "boolean" />
    </method>

</class>