diff --git a/dune-project b/dune-project index 16ac3e77..cd123544 100644 --- a/dune-project +++ b/dune-project @@ -50,4 +50,17 @@ (trace-tef :with-test) (odoc :with-doc))) +(package + (name moonpool-io) + (synopsis "Async IO for moonpool, relying on picos") + (allow_empty) ; on < 5.0 + (depends + (moonpool (= :version)) + picos_stdio + (ocaml (>= 5.0)) + (trace :with-test) + (trace-tef :with-test) + (odoc :with-doc))) + + ; See the complete stanza docs at https://dune.readthedocs.io/en/stable/dune-files.html#dune-project diff --git a/moonpool-io.opam b/moonpool-io.opam new file mode 100644 index 00000000..97eefe0b --- /dev/null +++ b/moonpool-io.opam @@ -0,0 +1,33 @@ +# This file is generated by dune, edit dune-project instead +opam-version: "2.0" +version: "0.6" +synopsis: "Async IO for moonpool, relying on picos" +maintainer: ["Simon Cruanes"] +authors: ["Simon Cruanes"] +license: "MIT" +homepage: "https://github.com/c-cube/moonpool" +bug-reports: "https://github.com/c-cube/moonpool/issues" +depends: [ + "dune" {>= "3.0"} + "moonpool" {= version} + "picos_stdio" + "ocaml" {>= "5.0"} + "trace" {with-test} + "trace-tef" {with-test} + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/c-cube/moonpool.git" diff --git a/src/io/dune b/src/io/dune new file mode 100644 index 00000000..2c01d4f9 --- /dev/null +++ b/src/io/dune @@ -0,0 +1,5 @@ +(library + (name moonpool_io) + (public_name moonpool-io) + (synopsis "Async IO for moonpool, using Picos") + (libraries moonpool picos_stdio picos_stdio.select picos_stdio.fd)) diff --git a/src/io/moonpool_io.ml b/src/io/moonpool_io.ml new file mode 100644 index 00000000..198a9671 --- /dev/null +++ b/src/io/moonpool_io.ml @@ -0,0 +1,11 @@ +module Fd = Picos_stdio_fd +module Unix = Picos_stdio.Unix +module Select = Picos_stdio_select + +let fd_of_unix_fd : Unix.file_descr -> Fd.t = Fun.id +let configure = Select.configure + +(** {2 Async read/write} *) + +let read = Unix.read +let write = Unix.write