Skip to content

Commit

Permalink
Merge pull request #38 from deepali2806/master
Browse files Browse the repository at this point in the history
Remove Yield effect from aio example
  • Loading branch information
kayceesrk authored Oct 22, 2023
2 parents 9444605 + 6857a65 commit 64ee712
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
9 changes: 1 addition & 8 deletions aio/aio.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ type file_descr = Unix.file_descr
type sockaddr = Unix.sockaddr
type msg_flag = Unix.msg_flag
type _ Effect.t += Fork : (unit -> unit) -> unit Effect.t
type _ Effect.t += Yield : unit Effect.t
type _ Effect.t += Accept : file_descr -> (file_descr * sockaddr) Effect.t

type _ Effect.t +=
Expand All @@ -24,7 +23,6 @@ type _ Effect.t +=
type _ Effect.t += Sleep : float -> unit Effect.t

let fork f = perform (Fork f)
let yield () = perform Yield
let accept fd = perform (Accept fd)
let recv fd buf pos len mode = perform (Recv (fd, buf, pos, len, mode))
let send fd bus pos len mode = perform (Send (fd, bus, pos, len, mode))
Expand Down Expand Up @@ -163,14 +161,9 @@ let run main =
effc =
(fun (type a) (e : a Effect.t) ->
match e with
| Yield ->
Some
(fun (k : (a, _) continuation) ->
enqueue_thread st k ();
schedule st)
| Fork f ->
Some
(fun k ->
(fun (k : (a, _) continuation) ->
enqueue_thread st k ();
fork st f)
| Accept fd ->
Expand Down
1 change: 0 additions & 1 deletion aio/aio.mli
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*)

val fork : (unit -> unit) -> unit
val yield : unit -> unit

type file_descr = Unix.file_descr
type sockaddr = Unix.sockaddr
Expand Down

0 comments on commit 64ee712

Please sign in to comment.