added 260907 version of worker toolkit

This commit is contained in:
2026-09-08 20:30:51 -04:00
parent cbd3f0f8ca
commit 97aca37663
1283 changed files with 142951 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
class PusherClient
include Singleton
def initialize
Pusher.app_id = ENV["PUSHER_APP_ID"]
Pusher.key = ENV["PUSHER_KEY"]
Pusher.secret = ENV["PUSHER_SECRET"]
end
def push(channel, event, message)
Pusher.trigger(channel, event, ActiveSupport::JSON.encode(message))
end
def authenticate!(user, socket_id)
Pusher[user.notification_channel].authenticate(socket_id, user_id: user.id)
end
end