summaryrefslogtreecommitdiff
path: root/prolog/runner/main.pl
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@araneo.org>2015-08-20 19:23:39 +0200
committerTimotej Lazar <timotej.lazar@araneo.org>2015-08-20 19:23:39 +0200
commit0d4edaca1dc14e16e5204b3af275570e869a9a0a (patch)
tree9034d3e43f441bc96ecbfe3e02d30c2cdf890a0f /prolog/runner/main.pl
parentb7e972aa0a215a2baa51e6b732313366a67ceca6 (diff)
Add a Prolog pengine server for running queries
Run with "swipl main.pl".
Diffstat (limited to 'prolog/runner/main.pl')
-rw-r--r--prolog/runner/main.pl25
1 files changed, 25 insertions, 0 deletions
diff --git a/prolog/runner/main.pl b/prolog/runner/main.pl
new file mode 100644
index 0000000..19281b1
--- /dev/null
+++ b/prolog/runner/main.pl
@@ -0,0 +1,25 @@
+% 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)]).