diff --git a/examples/websockets/config.ru b/examples/websockets/config.ru index 700764a6..e9fc8bd0 100644 --- a/examples/websockets/config.ru +++ b/examples/websockets/config.ru @@ -6,12 +6,12 @@ require 'async/websocket/adapters/rack' class App def call(env) Async::WebSocket::Adapters::Rack.open(env) do |connection| + message = Protocol::WebSocket::TextMessage.generate({body: "Hello World"}) + while true - connection.write({message: "Hello World"}) + connection.write(message) connection.flush - - # This is still needed for Ruby 2.7+ but is not needed in Ruby 3+ - Async::Task.current.sleep 1 + sleep 1 end end end diff --git a/examples/websockets/gems.locked b/examples/websockets/gems.locked new file mode 100644 index 00000000..d39e55a8 --- /dev/null +++ b/examples/websockets/gems.locked @@ -0,0 +1,92 @@ +PATH + remote: ../.. + specs: + falcon (0.47.8) + async + async-container (~> 0.18) + async-http (~> 0.66, >= 0.66.3) + async-http-cache (~> 0.4.0) + async-service (~> 0.10) + bundler + localhost (~> 1.1) + openssl (~> 3.0) + process-metrics (~> 0.2.0) + protocol-rack (~> 0.5) + samovar (~> 2.3) + +GEM + remote: https://rubygems.org/ + specs: + async (2.16.0) + console (~> 1.26) + fiber-annotation + io-event (~> 1.6, >= 1.6.5) + async-container (0.18.2) + async (~> 2.10) + async-http (0.70.0) + async (>= 2.10.2) + async-pool (~> 0.7) + io-endpoint (~> 0.11) + io-stream (~> 0.4) + protocol-http (~> 0.28) + protocol-http1 (~> 0.19) + protocol-http2 (~> 0.18) + traces (>= 0.10) + async-http-cache (0.4.4) + async-http (~> 0.56) + async-pool (0.8.0) + async (>= 1.25) + async-service (0.12.0) + async + async-container (~> 0.16) + async-websocket (0.28.0) + async-http (~> 0.54) + protocol-http (>= 0.28.1) + protocol-rack (~> 0.5) + protocol-websocket (~> 0.15) + console (1.27.0) + fiber-annotation + fiber-local (~> 1.1) + json + fiber-annotation (0.2.0) + fiber-local (1.1.0) + fiber-storage + fiber-storage (1.0.0) + io-endpoint (0.13.0) + io-event (1.6.5) + io-stream (0.4.0) + json (2.7.2) + localhost (1.3.1) + mapping (1.1.1) + openssl (3.2.0) + process-metrics (0.2.1) + console (~> 1.8) + samovar (~> 2.1) + protocol-hpack (1.5.0) + protocol-http (0.28.2) + protocol-http1 (0.19.1) + protocol-http (~> 0.22) + protocol-http2 (0.18.0) + protocol-hpack (~> 1.4) + protocol-http (~> 0.18) + protocol-rack (0.6.0) + protocol-http (~> 0.23) + rack (>= 1.0) + protocol-websocket (0.15.0) + protocol-http (~> 0.2) + rack (3.1.7) + samovar (2.3.0) + console (~> 1.0) + mapping (~> 1.0) + traces (0.13.1) + +PLATFORMS + ruby + x86_64-linux + +DEPENDENCIES + async-websocket + falcon! + +BUNDLED WITH + 2.5.16