@@ -28,7 +28,7 @@ let error_handler notifier e =
2828 | `Malformed_response err -> Format. sprintf " malformed response: %s" err
2929 | `Invalid_response_body_length _ -> " invalid body length"
3030 | `Exn exn -> Printexc. to_string exn in
31- Lwt. wakeup notifier (Error e)
31+ Lwt. wakeup_later notifier (Error e)
3232
3333let send ~content wsd =
3434 let len, off = String. length content, 0 in
@@ -55,7 +55,7 @@ let websocket_handler ?error ~react notifier action_notifier wsd =
5555 Wsd. close ?code wsd; Lwt. return_ok () in
5656 let send content = send ~content wsd; Lwt. return_ok () in
5757 let action = { send; close } in
58- Lwt. wakeup action_notifier action;
58+ Lwt. wakeup_later action_notifier action;
5959 let frame ~opcode ~is_fin ~len :_ payload = match opcode with
6060 | `Ping ->
6161 read_payload ~payload @@ fun content ->
@@ -74,10 +74,10 @@ let websocket_handler ?error ~react notifier action_notifier wsd =
7474 Lwt. return_unit)
7575 | `Connection_close ->
7676 Wsd. close wsd;
77- Lwt. wakeup notifier (Ok () )
77+ Lwt. wakeup_later notifier (Ok () )
7878 | _ ->
7979 Wsd. close ~code: `Protocol_error wsd;
80- Lwt. wakeup notifier (Error " protocol error" ) in
80+ Lwt. wakeup_later notifier (Error " protocol error" ) in
8181 let eof ?error () =
8282 Option. iter (function `Exn exn -> Format. eprintf " websocket eof error: %s@." (Printexc. to_string exn )) error;
8383 Wsd. close wsd in
0 commit comments