class CPEE::Notifications::SSE

Public Instance Methods

onclose() click to toggle source
# File lib/cpee/implementation_notifications.rb, line 233
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() click to toggle source
# File lib/cpee/implementation_notifications.rb, line 220
def onopen
  @opts = @a[1]
  @id = @a[0].to_s
  @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