Class: CPEE::Notifications::SSE
- Inherits:
-
Riddl::SSEImplementation
- Object
- Riddl::SSEImplementation
- CPEE::Notifications::SSE
- Defined in:
- lib/cpee/implementation_notifications.rb
Overview
}}}
Instance Method Summary collapse
Instance Method Details
#onclose ⇒ Object
214 215 216 217 218 |
# File 'lib/cpee/implementation_notifications.rb', line 214 def onclose @opts.dig(:sse_connections,@id)&.delete(@key) @opts.dig(:sse_connections)&.delete(@id) if @opts.dig(:sse_connections,@id)&.length == 0 DeleteSubscription::set(@id,@opts,@key) end |
#onopen ⇒ Object
{{{
201 202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/cpee/implementation_notifications.rb', line 201 def onopen @opts = @a[1] @id = @a[0] @key = @r[-2] if !@opts[:statemachine].readonly?(@id) && CPEE::Persistence::exists_handler?(@id,@opts,@key) @opts[:sse_connections][@id] ||= {} @opts[:sse_connections][@id][@key] = self true else false end end |