rkh / async-rack Goto Github PK
View Code? Open in Web Editor NEWMakes middleware that ships with Rack bullet-proof for async responses.
License: University of Illinois/NCSA Open Source License
Makes middleware that ships with Rack bullet-proof for async responses.
License: University of Illinois/NCSA Open Source License
When I start this simple server, I get an error: Server handler (thin) not found. (RuntimeError)
require 'async-rack'
require 'sinatra'
set :server, 'thin'
get '/' do
"Hello, world!"
end
If I comment out the require 'async-rack'
line, it starts Thin fine. If I comment out the set :server, 'thin'
and use async-rack, it starts WEBrick.
[1] pry(main)> require 'async-rack'
=> true
[2] pry(main)> require 'rack/head'
NameError: uninitialized constant Rack::Head
from /Users/jonas/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/async-rack-0.5.1/lib/async_rack/async_callback.rb:7:in `const_get'
[3] pry(main)> Rack::Head
=> AsyncRack::Head
What am I doing wrong?
Bonus:
# inserted by me before line 7 of async-rack-0.5.1/lib/async_rack/async_callback.rb
puts [namespace.constants.include?(name), namespace.const_defined?(name)]
# => [true, false]
Here are a few issues I found with current approach to ruby async web stack (or lack of one), including this gem:
throw :async
scares me.Why we need a separate rack-like API for async web apps:
P.s. Sorry for putting this here as an issue, I couldn't find any discussion about this possibility anywhere, so I'm trying to see if other people's opinions on this idea.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.