Module: Roda::RodaPlugins::SSE::RequestMethods

Defined in:
lib/roda/plugins/sse.rb

Constant Summary collapse

HEADERS =
{
  'content-type' => 'text/event-stream',
  'cache-control' => 'no-cache',
}.freeze

Instance Method Summary collapse

Instance Method Details

#sse(&block) ⇒ Object



64
65
66
67
68
# File 'lib/roda/plugins/sse.rb', line 64

def sse(&block)
  get do
    halt [200, HEADERS.dup, Body.new(block)]
  end
end