You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/SETTINGS.md
+6-14Lines changed: 6 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ The ``pebSettings`` JavaScript object may have the following properties:
54
54
``String`` displayed as a label for the 'No' button on JavaScript Confirm popup box.
55
55
56
56
***closeConfirmation**
57
-
``String`` displayed in a JavaScript Confirm popup box when the close button is pressed, but unsaved data in local HTML forms is detected. If no ``closeConfirmation`` object property is found, PEB exits immediately.
57
+
``String`` displayed in a JavaScript Confirm popup box when the close button is pressed, but unsaved data in local HTML forms is detected. If no ``closeConfirmation`` object property is found, PEB shuts down all running Perl scripts and exits.
58
58
59
59
## Perl Scripts API
60
60
@@ -148,17 +148,15 @@ A JavaScript settings object for a Perl script run by PEB has the following prop
148
148
149
149
## Interactive Perl Scripts
150
150
151
-
Each PEB interactive Perl script must have its own event loop waiting constantly for new data on STDIN for a bidirectional connection with PEB. Many interactive scripts can be started simultaneously in one PEB instance. One script may be started in many instances, provided that each of them has a uniquely named JavaScript settings object.
152
-
153
-
Please note that interactive Perl scripts are not supported by the Windows builds of PEB.
151
+
Each PEB interactive Perl script must have its own event loop waiting constantly for new data on STDIN or in a temporary file for a bidirectional connection with PEB. Many interactive scripts can be started simultaneously in one PEB instance. One script may be started in many instances, provided that each of them has an uniquely named JavaScript settings object.
154
152
155
153
A PEB interactive Perl script should have the following features:
156
154
157
155
***No buffering**
158
156
PEB interactive scripts should have ``$|=1;`` among their first lines to disable the built-in buffering of the Perl interpreter, which prevents any output before the script has ended.
159
157
160
158
***Failsafe print**
161
-
Failsafe print is necessary for a graceful shutdown of Perl scripts on normal PEB exit and when PEB unexpectedly crashes. PEB closes the STDOUT and STDERR channels of all running Perl scripts when the close button is pressed - they must exit in 3 seconds or any unresponsive scripts are killed.
159
+
Failsafe print is necessary for a graceful shutdown of Perl scripts on normal PEB exit and when PEB unexpectedly crashes. When the close button is pressed, PEB closes the STDOUT and STDERR channels of all running Perl scripts and within 3 seconds they must detect their inability to print messages and exit or any unresponsive scripts will be killed.
162
160
163
161
Failsafe print could be implemented using the following code:
164
162
@@ -171,7 +169,7 @@ A PEB interactive Perl script should have the following features:
171
169
}
172
170
```
173
171
174
-
The following code shows how to start a PEB interactive Perl script right after a local page is loaded:
172
+
The following code shows how to start a PEB interactive Perl script right after the PEB index page is loaded:
175
173
176
174
```html
177
175
<!DOCTYPE html>
@@ -209,15 +207,9 @@ The following code shows how to start a PEB interactive Perl script right after
209
207
</html>
210
208
```
211
209
212
-
The [index.htm of the demo package](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/index.html) shows how to start one Perl script in two instances right after the PEB index page is loaded.
213
-
214
-
The [interactive.pl](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/perl/interactive.pl) script of the demo package is an example of a Perl interactive script for PEB.
215
-
216
-
## Long-Running Windows Perl Scripts
217
-
218
-
Long-running Windows Perl scripts are supported provided that they also have ``$|=1;`` among their first lines to disable the built-in buffering of the Perl interpreter.
210
+
The [index.htm of the demo package](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/index.html) demonstrates how to start one Perl interactive script in two instances immediately after the PEB index page is loaded.
219
211
220
-
Windows Perl scripts can not receive the ``SIGTERM`` signal and if they are still running when PEB is closed, they can only be killed with no mechanism for a graceful shutdown.
212
+
The [interactive.pl script of the demo package](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/perl/interactive.pl)is an example of a Perl interactive script for PEB.
0 commit comments