activitypub-academy/app/lib/activity_logger.rb
2023-01-09 14:48:03 +01:00

20 lines
292 B
Ruby

# frozen_string_literal: true
class ActivityLogger
@@loggers = Hash.new
def self.register(id, sse)
@@loggers[id] = sse
end
def self.unregister(id)
@@loggers.delete(id)
end
def self.log(id, event)
if @@loggers[id]
@@loggers[id].write event
end
end
end