package bytebuffer
All checked builds passInstall
dune-project
Dependency
Authors
Maintainers
Sources
sha256=6de8da90c7442c69d3ff2d82c393804dae4e90fe3abd963a896e825669c95dfd
sha512=496184c91b228dd19fa2074ca091b887b0d148af4207ebedfbad8b95582a600f13ba61c2c68bd316a5f74e69c1b964f5c690f5b212b29b80235e23958969c12e
Description
Added to opam-repository:
README
H1
h1 is a simple http 1.1 implementation. The core protocol layout doesn't enforce any concurrency strategry and as a result it is possible to provide small translation modules that can provide an Lwt or Async aware interface.
Warning
This is currently a proof-of-concept. There are many rough edges and probably many bugs. Use it at your own risk. That said, the approach seems to work well and in my initial tests the performance seems pretty decent. With some more effort it should be possible to get to a respectable state with extensive tests.
Features/Goals
- Asynchronous pull based design
- No I/O in the core library. Use it with any I/O paradigm (async, sync, threaded, etc)
Usage
HTTP Server
Example using async:
let run (sock : Fd.t) =
let service (req, _body) =
let target = Request.path req in
let resp =
Response.create
~headers:
(Headers.of_list
[ ("Content-Length", Int.to_string (Base_bigstring.length text)) ])
`Ok
in
match target with
| "/delay" ->
let%map () = after Time.Span.millisecond in
(resp, `Bigstring text)
| _ -> return (resp, `Bigstring text)
in
let conn =
H1_async.create sock ~read_buffer_size:(10 * 1024)
~write_buffer_size:(10 * 1024)
in
H1_async.run conn serviceTodo
- Chunked Encoding
- 0 copy streaming for bodies
- Better error handling
- Add docs
- Http client implementation (This can be pushed till after a full working/tested/documented server implementation)
Dependencies (3)
-
ocaml
>= "4.11.0" - base_bigstring
-
dune
>= "2.8"
Optional Dependencies
None
Used by
None
Conflicts
None
Build status
Results of building bytebuffer with each compiler on check.ci.ocaml.org, run of against opam-repository 8a77e58. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
| Version | OCaml 4.11 | OCaml 4.14 | OCaml 5.2 | OCaml 5.4 | OCaml 5.5 |
|---|---|---|---|---|---|
| 0.0.2 (this version) | good | good | good | good | good |
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure