This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UserBroadcastJob < ApplicationJob | |
include Sidekiq::Worker | |
def perform(user_id) | |
begin | |
user = User.find_by(id: user_id) | |
return if user.blank? | |
stages = user.meeting.stages | |
stages.each do |stage| | |
if stage.polls.present? | |
ActionCable.server.broadcast("poll_dashboard_channel-#{user.meeting.id}", { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.dashboard = App.cable.subscriptions.create({ channel: "PollDashboardChannel", meeting_id: meeting_id, stage_item_type: 'Poll', stage_item_id: poll_id }, { | |
received: function(data) { | |
..... | |
switch(data.action) { | |
...... | |
case 'destroy': | |
...... | |
break; | |
case 'update_user_image': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def update | |
...... | |
if @user.update_attributes(user_params) | |
flash[:success] = '์ ์ฅ๋์์ต๋๋ค' | |
broadcast_user_updated(@user) | |
redirect_to @meeting | |
else | |
..... | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <signal.h> | |
#include <pthread.h> | |
#include <sys/signalfd.h> | |
#include <sys/time.h> | |
#include <sys/types.h> | |
#define handle_error(msg) \ |