Skip to content

Commit

Permalink
feat: add moonpool-io
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Sep 3, 2024
1 parent a131448 commit d16ae86
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -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
33 changes: 33 additions & 0 deletions moonpool-io.opam
Original file line number Diff line number Diff line change
@@ -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"
5 changes: 5 additions & 0 deletions src/io/dune
Original file line number Diff line number Diff line change
@@ -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))
11 changes: 11 additions & 0 deletions src/io/moonpool_io.ml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d16ae86

Please sign in to comment.