From 157082a90bb31bd52abf7543d42523186d441c37 Mon Sep 17 00:00:00 2001 From: craff Date: Tue, 6 Dec 2022 14:27:07 -1000 Subject: [PATCH] add tiny_httpd_domains --- src/domains/Tiny_httpd_domains.ml | 7 +++++++ src/domains/dune | 7 +++++++ tiny_httpd_domains.opam | 23 +++++++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 src/domains/Tiny_httpd_domains.ml create mode 100644 src/domains/dune create mode 100644 tiny_httpd_domains.opam diff --git a/src/domains/Tiny_httpd_domains.ml b/src/domains/Tiny_httpd_domains.ml new file mode 100644 index 00000000..79a47505 --- /dev/null +++ b/src/domains/Tiny_httpd_domains.ml @@ -0,0 +1,7 @@ + + +let new_thread pool f = + ignore (Domainslib.Task.async pool f) + +let run pool server = + Domainslib.Task.run pool (fun () -> Tiny_httpd.run server) diff --git a/src/domains/dune b/src/domains/dune new file mode 100644 index 00000000..1aa16574 --- /dev/null +++ b/src/domains/dune @@ -0,0 +1,7 @@ + +(library + (name tiny_httpd_domains) + (public_name tiny_httpd_domains) + (synopsis "Allowing to use ocaml domains instead of theads") + (flags :standard -safe-string -warn-error -a+8) + (libraries tiny_httpd domainslib)) diff --git a/tiny_httpd_domains.opam b/tiny_httpd_domains.opam new file mode 100644 index 00000000..a9a31e15 --- /dev/null +++ b/tiny_httpd_domains.opam @@ -0,0 +1,23 @@ +opam-version: "2.0" +version: "0.12" +authors: ["Christophe Raffalli"] +maintainer: "simon.cruanes.2007@m4x.org" +license: "MIT" +synopsis: "Interface to camlzip for tiny_httpd" +build: [ + ["dune" "build" "@install" "-p" name "-j" jobs] + ["dune" "build" "@doc" "-p" name] {with-doc} + ["dune" "runtest" "-p" name] {with-test} +] +depends: [ + "dune" { >= "2.0" } + "tiny_httpd" { = version } + "ocaml" { >= "5.00.0" } + "odoc" {with-doc} + "domainslib" +] +tags: [ "http" "thread" "server" "domain" ] +homepage: "https://github.com/c-cube/tiny_httpd/" +doc: "https://c-cube.github.io/tiny_httpd/" +bug-reports: "https://github.com/c-cube/tiny_httpd/issues" +dev-repo: "git+https://github.com/c-cube/tiny_httpd.git"