Sha256: c6939b5101204a3a2be935d27619a0d62f4ac84a29aee8e7ec74dcff4b5be95a
Contents?: true
Size: 539 Bytes
Versions: 17
Compression:
Stored size: 539 Bytes
Contents
# based on examples/streaming.rb in git://github.com/lifo/cramp # commit ca54f8a944ae582a0c858209daf3c74efea7d27c # Rack::Lint does not like async + EM stuff, so disable it: #\ -E deployment require 'cramp/controller' class StreamController < Cramp::Controller::Action periodic_timer :send_data, :every => 1 periodic_timer :check_limit, :every => 2 def start @limit = 0 end def send_data render ["Hello World", "\n"] end def check_limit @limit += 1 finish if @limit > 1 end end run StreamController
Version data entries
17 entries across 17 versions & 1 rubygems