summaryrefslogtreecommitdiff
path: root/prolog/runner/main.pl
blob: 303cb268ed3c1f1425d1abf1fb16745a91a3883b (plain)
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
#!/usr/bin/swipl -q -s

% Pengine and HTTP server modules.
:- use_module(library(http/http_dispatch)).
:- use_module(library(http/http_error)).
:- use_module(library(http/thread_httpd)).
:- use_module(library(pengines)).
:- use_module(library(pengines_io)).

:- use_module(library(clpfd)).
:- use_module(library(clpr)).

:- consult(sandbox).

:- multifile prolog:error_message/3.
prolog:error_message(time_limit_exceeded) -->
  [ 'time limit exceeded' ].

:- set_setting(pengine_sandbox:time_limit, 5.0).
:- set_setting(pengine_sandbox:thread_pool_size, 50).

% Start the server.
:- http_server(http_dispatch,
                [port(3030),
                 workers(10),
                 timeout(30),
                 keep_alive_timeout(30)]).
:- writeln('Prolog engine started.').