Skip to content

Instantly share code, notes, and snippets.

View jpcamara's full-sized avatar

JP Camara jpcamara

View GitHub Profile
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)
# first window
bundle install
bundle exec bento --falcon
# second window
make wsdirector # works
SCENARIO=broadcast make wsdirector # works
make anyt-falcon # works
# In your Gemfile
gem "localhost"

# Then, depending on your desired server
gem "falcon"
gem "puma"
# 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