Module: Sinatra::SSE
- Extended by:
- Marshal
- Defined in:
- lib/sinatra/sse.rb,
lib/sinatra/sse/version.rb,
lib/sinatra/sse.rb
Overview
Support for SSE streams.
The Sinatra::SSE module adds support for streaming server sent events.
It wraps a sinatra stream (via stream :keep_open
) in a structure which
-
formats events according to the SSE specs, and
-
keeps the connection alive by sending some data every 28 seconds.
Defined Under Namespace
Modules: Marshal Classes: Stream
Constant Summary collapse
- VERSION =
The Sinatra::SSE version number
"0.1"
- KEEP_ALIVE =
The keepalive period.
28
Constants included from Marshal
Instance Method Summary collapse
-
#sse_stream(&block) ⇒ Object
Start a SSE stream.