activitypub-academy/app/lib/activity_logger.rb
2023-04-17 17:50:35 +02: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