Skip to content

Commit

Permalink
tweak prev change
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro committed Jul 28, 2024
1 parent 5af38bf commit 9ebdbe9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 27 deletions.
14 changes: 7 additions & 7 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 21 additions & 20 deletions lwt/gluten_lwt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ module IO_loop = struct
(fun n -> Lwt.wakeup_later u n);
p

let start : type t fd.
(module IO with type socket = fd)
-> (module Gluten.RUNTIME with type t = t)
-> t
-> read_buffer_size:int
-> fd
-> unit Lwt.t
let start :
type t fd.
(module IO with type socket = fd)
-> (module Gluten.RUNTIME with type t = t)
-> t
-> read_buffer_size:int
-> fd
-> unit Lwt.t
=
fun (module Io) (module Runtime) t ~read_buffer_size socket ->
let read_buffer = Buffer.create read_buffer_size in
Expand All @@ -64,9 +65,9 @@ module IO_loop = struct
| `Read ->
Lwt.catch
(fun () ->
read (module Io) socket read_buffer >>= fun (_ : int) ->
read (module Io) socket read_buffer >|= fun (_ : int) ->
let (_ : int) = Buffer.get read_buffer ~f:(Runtime.read t) in
Lwt.return_unit)
())
(function
| End_of_file ->
let (_ : int) =
Expand Down Expand Up @@ -122,11 +123,11 @@ module Server (Io : IO) = struct
type addr = Io.addr

let create_connection_handler
~read_buffer_size
~protocol
connection
_client_addr
socket
~read_buffer_size
~protocol
connection
_client_addr
socket
=
let connection = Server.create ~protocol connection in
IO_loop.start
Expand All @@ -137,12 +138,12 @@ module Server (Io : IO) = struct
socket

let create_upgradable_connection_handler
~read_buffer_size
~protocol
~create_protocol
~request_handler
client_addr
socket
~read_buffer_size
~protocol
~create_protocol
~request_handler
client_addr
socket
=
let connection =
Server.create_upgradable
Expand Down

0 comments on commit 9ebdbe9

Please sign in to comment.