Sha256: 017839d9fb27898d23686aa0a2731643884afc3404df391e84d3fffc360a09e1

Contents?: true

Size: 574 Bytes

Versions: 3

Compression:

Stored size: 574 Bytes

Contents

# frozen_string_literal: true

# this example does *not* work properly with WEBrick
#
# run *one* of these:
#
#   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

3 entries across 3 versions & 2 rubygems

Version Path
sinatra-rack-3-commonlit-3.0.6 examples/stream.ru
sinatra-rack-3-commonlit-3.1.0 examples/stream.ru
sinatra-3.1.0 examples/stream.ru