# In your Gemfile
gem "localhost"
# Then, depending on your desired server
gem "falcon"
gem "puma"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# hangs, same as MN threads | |
# RUBY_MN_THREADS=1 make test-all TESTS="--name=TestIO#test_open_fifo_does_not_block_other_threads" | |
require "tempfile" | |
require "async" | |
def mkcdtmpdir | |
Dir.mktmpdir {|d| | |
Dir.chdir(d) { | |
yield |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# first window | |
bundle install | |
bundle exec bento --falcon | |
# second window | |
make wsdirector # works | |
SCENARIO=broadcast make wsdirector # works | |
make anyt-falcon # works |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Run with ruby-3.4.0-preview2 | |
- gem install falcon | |
- RUBY_YJIT_ENABLE=1 falcon serve --bind http://localhost:4001 --count 1 -c chat_server.ru | |
- bun run chat-client.mjs | |
Connecting 32 WebSocket clients... | |
[186.53ms] All 32 clients connected | |
230567 messages per second (32 clients x 1600 msg, min delay: 64ms) | |
239922 messages per second (32 clients x 1600 msg, min delay: 64ms) | |
271556 messages per second (32 clients x 1600 msg, min delay: 64ms) |