mirror of
https://github.com/c-cube/nanoev.git
synced 2025-12-06 03:05:32 -05:00
Compare commits
3 commits
604224d1cf
...
870093e93a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
870093e93a | ||
|
|
066604538f | ||
|
|
9b2107ec7c |
7 changed files with 27 additions and 21 deletions
3
CHANGES.md
Normal file
3
CHANGES.md
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
# 0.1
|
||||||
|
|
||||||
|
initial release, with poll and select backends.
|
||||||
|
|
@ -1,16 +1,11 @@
|
||||||
(lang dune 2.7)
|
(lang dune 2.7)
|
||||||
|
|
||||||
(name nanoev)
|
(name nanoev)
|
||||||
|
|
||||||
(generate_opam_files true)
|
(generate_opam_files true)
|
||||||
|
|
||||||
(source
|
(source
|
||||||
(github c-cube/nanoev))
|
(github c-cube/nanoev))
|
||||||
|
|
||||||
(authors "Simon Cruanes")
|
(authors "Simon Cruanes")
|
||||||
|
|
||||||
(maintainers "Simon Cruanes")
|
(maintainers "Simon Cruanes")
|
||||||
|
(version 0.1)
|
||||||
(license MIT)
|
(license MIT)
|
||||||
|
|
||||||
;(documentation https://url/to/documentation)
|
;(documentation https://url/to/documentation)
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,11 @@ let main () : unit =
|
||||||
let n_tasks_done = Atomic.make 0 in
|
let n_tasks_done = Atomic.make 0 in
|
||||||
let n_sent = Atomic.make 0 in
|
let n_sent = Atomic.make 0 in
|
||||||
let n_recv = Atomic.make 0 in
|
let n_recv = Atomic.make 0 in
|
||||||
|
|
||||||
|
let remoteaddr = Unix.ADDR_INET (Unix.inet_addr_loopback, !port) in
|
||||||
|
|
||||||
|
(let@ pool = Moonpool.Ws_pool.with_ ~num_threads:!j () in
|
||||||
|
|
||||||
ignore
|
ignore
|
||||||
(Thread.create
|
(Thread.create
|
||||||
(fun () ->
|
(fun () ->
|
||||||
|
|
@ -31,10 +36,6 @@ let main () : unit =
|
||||||
()
|
()
|
||||||
: Thread.t);
|
: Thread.t);
|
||||||
|
|
||||||
(let@ pool = Moonpool.Ws_pool.with_ ~num_threads:!j () in
|
|
||||||
|
|
||||||
let remoteaddr = Unix.ADDR_INET (Unix.inet_addr_loopback, !port) in
|
|
||||||
|
|
||||||
let task () =
|
let task () =
|
||||||
let[@alert "-deprecated"] _sp =
|
let[@alert "-deprecated"] _sp =
|
||||||
Trace.enter_manual_toplevel_span ~__FILE__ ~__LINE__ "task.run"
|
Trace.enter_manual_toplevel_span ~__FILE__ ~__LINE__ "task.run"
|
||||||
|
|
@ -64,6 +65,9 @@ let main () : unit =
|
||||||
done
|
done
|
||||||
in
|
in
|
||||||
|
|
||||||
|
if Random.float 1. > 0.992 then
|
||||||
|
Trace.counter_int "n-tasks" (Moonpool.Runner.num_tasks pool);
|
||||||
|
|
||||||
Picos.Fiber.(yield ());
|
Picos.Fiber.(yield ());
|
||||||
|
|
||||||
(* receive a response *)
|
(* receive a response *)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
# This file is generated by dune, edit dune-project instead
|
# This file is generated by dune, edit dune-project instead
|
||||||
opam-version: "2.0"
|
opam-version: "2.0"
|
||||||
|
version: "0.1"
|
||||||
synopsis: "Use nanoev from picos"
|
synopsis: "Use nanoev from picos"
|
||||||
maintainer: ["Simon Cruanes"]
|
maintainer: ["Simon Cruanes"]
|
||||||
authors: ["Simon Cruanes"]
|
authors: ["Simon Cruanes"]
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
# This file is generated by dune, edit dune-project instead
|
# This file is generated by dune, edit dune-project instead
|
||||||
opam-version: "2.0"
|
opam-version: "2.0"
|
||||||
|
version: "0.1"
|
||||||
synopsis: "Use mtime+iomux (posix compliant) as a backend for nanoev"
|
synopsis: "Use mtime+iomux (posix compliant) as a backend for nanoev"
|
||||||
maintainer: ["Simon Cruanes"]
|
maintainer: ["Simon Cruanes"]
|
||||||
authors: ["Simon Cruanes"]
|
authors: ["Simon Cruanes"]
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
# This file is generated by dune, edit dune-project instead
|
# This file is generated by dune, edit dune-project instead
|
||||||
opam-version: "2.0"
|
opam-version: "2.0"
|
||||||
|
version: "0.1"
|
||||||
synopsis: "Tiny event loop abstraction"
|
synopsis: "Tiny event loop abstraction"
|
||||||
maintainer: ["Simon Cruanes"]
|
maintainer: ["Simon Cruanes"]
|
||||||
authors: ["Simon Cruanes"]
|
authors: ["Simon Cruanes"]
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
# This file is generated by dune, edit dune-project instead
|
# This file is generated by dune, edit dune-project instead
|
||||||
opam-version: "2.0"
|
opam-version: "2.0"
|
||||||
|
version: "0.1"
|
||||||
synopsis: "Use nanoev as a basis for tiny_httpd"
|
synopsis: "Use nanoev as a basis for tiny_httpd"
|
||||||
maintainer: ["Simon Cruanes"]
|
maintainer: ["Simon Cruanes"]
|
||||||
authors: ["Simon Cruanes"]
|
authors: ["Simon Cruanes"]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue