Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update switch test for Eio 1.0 #4

Merged
merged 1 commit into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
(description "An Eio scheduler suitable for JavaScript environments.")
(depends
(mdx (and (>= 2.4.1) :with-test))
(eio (>= 0.14))))
(eio (>= 1.0))))
(package
(name eio_brr)
(synopsis "Eio support for Brr")
Expand Down
2 changes: 1 addition & 1 deletion eio_js_backend.opam
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bug-reports: "https://github.com/ocaml-multicore/eio_js/issues"
depends: [
"dune" {>= "3.9"}
"mdx" {>= "2.4.1" & with-test}
"eio" {>= "0.14"}
"eio" {>= "1.0"}
"odoc" {with-doc}
]
build: [
Expand Down
10 changes: 8 additions & 2 deletions lib_eio_js_backend/tests/switch.md
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,13 @@ Using switch from inside release handler:
);
Switch.on_release sw (fun () ->
Fiber.fork ~sw (fun () ->
Switch.on_release sw (fun () -> traceln "Late release");
traceln "Starting release 2";
begin
try
Switch.on_release sw (fun () -> traceln "Immediate release");
with Invalid_argument msg ->
traceln "on_release refused: %s" msg
end;
Fiber.yield ();
traceln "Finished release 2"
);
Expand All @@ -387,10 +392,11 @@ Using switch from inside release handler:
);;
+Main fiber done
+Starting release 2
+Immediate release
+on_release refused: Switch finished!
+Starting release 1
+Finished release 2
+Finished release 1
+Late release
- : unit = ()
```

Expand Down