From 7db5e8ed8144540a9bd826925d74053d1ab3ba61 Mon Sep 17 00:00:00 2001 From: Joe Eli McIlvain Date: Wed, 15 Feb 2023 11:50:51 -0800 Subject: [PATCH] Update example to latest TCP library usage. The `TCP.Engine.pending_reads` method is deprecated, and is no longer necessary to use. So we remove our usage of it. --- examples/simple/src/Main.savi | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/examples/simple/src/Main.savi b/examples/simple/src/Main.savi index 3e2735c..1b8af02 100644 --- a/examples/simple/src/Main.savi +++ b/examples/simple/src/Main.savi @@ -39,19 +39,17 @@ :fun ref io_react(action IO.Action) case action == ( | IO.Action.Read | - @io.pending_reads -> (data | - try ( - request = @reader.read!(@io.read_stream) + try ( + request = @reader.read!(@io.read_stream) - response = HTTPServer.ResponseBuilder.new(@io.write_stream) + response = HTTPServer.ResponseBuilder.new(@io.write_stream) - response - .status_ok - .header("Content-Length", "0") - .finish + response + .status_ok + .header("Content-Length", "0") + .finish - try @io.flush! - ) + try @io.flush! ) | IO.Action.Write | try @io.flush!