mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-06 11:15:38 -05:00
feat: add moonpool-io
This commit is contained in:
parent
a13144810e
commit
d16ae869a2
4 changed files with 62 additions and 0 deletions
13
dune-project
13
dune-project
|
|
@ -50,4 +50,17 @@
|
||||||
(trace-tef :with-test)
|
(trace-tef :with-test)
|
||||||
(odoc :with-doc)))
|
(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
|
; See the complete stanza docs at https://dune.readthedocs.io/en/stable/dune-files.html#dune-project
|
||||||
|
|
|
||||||
33
moonpool-io.opam
Normal file
33
moonpool-io.opam
Normal file
|
|
@ -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
src/io/dune
Normal file
5
src/io/dune
Normal file
|
|
@ -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
src/io/moonpool_io.ml
Normal file
11
src/io/moonpool_io.ml
Normal file
|
|
@ -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
|
||||||
Loading…
Add table
Reference in a new issue