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
210 211 212 213 214 |
# File 'lib/cpee/implementation_notifications.rb', line 210 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
{{{
197 198 199 200 201 202 203 204 205 206 207 208 |
# File 'lib/cpee/implementation_notifications.rb', line 197 def onopen @opts = @a[1] @id = @a[0] @key = @r[-2] if CPEE::Persistence::exists_handler?(@id,@opts,@key) @opts[:sse_connections][@id] ||= {} @opts[:sse_connections][@id][@key] = self true else false end end |