Sha256: 23da623f991d9499a139355ee09a4864352358184c4bcf7da6b743c28617da3a

Contents?: true

Size: 636 Bytes

Versions: 11

Compression:

Stored size: 636 Bytes

Contents

# frozen_string_literal: true

# this example does *not* work properly with WEBrick
#
# run *one* of these:
#
#   rackup -s mongrel stream.ru         # gem install mongrel
#   unicorn stream.ru                   # gem install unicorn
#   puma stream.ru                      # gem install puma
#   rainbows -c rainbows.conf stream.ru # gem install rainbows eventmachine

require 'sinatra/base'

class Stream < Sinatra::Base
  get '/' do
    content_type :txt

    stream do |out|
      out << "It's gonna be legen -\n"
      sleep 0.5
      out << " (wait for it) \n"
      sleep 1
      out << "- dary!\n"
    end
  end
end

run Stream

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.5/examples/stream.ru
sinatra-3.0.6 examples/stream.ru
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.5/examples/stream.ru
rubypitaya-3.12.3 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.5/examples/stream.ru
rubypitaya-3.12.2 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/sinatra-3.0.5/examples/stream.ru
sinatra-3.0.5 examples/stream.ru
sinatra-3.0.4 examples/stream.ru
sinatra-3.0.3 examples/stream.ru
sinatra-3.0.2 examples/stream.ru
sinatra-3.0.1 examples/stream.ru
sinatra-3.0.0 examples/stream.ru