|
You are here |
raganwald.com | ||
| | | | |
tenderlovemaking.com
|
|
| | | | | TL;DR: Rack API is poor when you consider streaming response bodies. class FooApplication class ErbPage def to_a head = "the head tag" sleep(2) body = "the body tag" sleep(2) [head, body] end end def call(env) [200, {}, ErbPage.new.to_a] end end class FakeRack def serve(application) status, headers, body = application.call({}) p :status => status p :headers => headers body.each do |string| p string end body.close if body.respond_to?(:close) end end app = FooApplication.new rack = FakeRack.new rack.serve app $ time ruby foo.rb {:status=>200} {:headers=>{}} "the head tag" "the body tag" real 0m4.008s user 0m0.003s sys 0m0.003s class ResponseTimer def initialize(app) @app = app end def call(env) now = Time.now status, headers, body = @app.call(env) headers['X-R... | |
| | | | |
weblog.raganwald.com
|
|
| | | | | ||
| | | | |
www.railstips.org
|
|
| | | | | ||
| | | | |
phiresky.github.io
|
|
| | | Using relational databases in a typed language is a pain unless you have great libraries to support you. There's a lot of different libraries for TypeScript, but they all have their own advantages and flaws. Since it's hard to find anything other than TypeORM, this is a short list of the | ||