aboutsummaryrefslogtreecommitdiffstats
path: root/lib/action_cable/server
diff options
context:
space:
mode:
Diffstat (limited to 'lib/action_cable/server')
-rw-r--r--lib/action_cable/server/base.rb2
-rw-r--r--lib/action_cable/server/broadcasting.rb6
-rw-r--r--lib/action_cable/server/configuration.rb2
-rw-r--r--lib/action_cable/server/worker.rb5
4 files changed, 12 insertions, 3 deletions
diff --git a/lib/action_cable/server/base.rb b/lib/action_cable/server/base.rb
index 5b7ddf4185..f1585dc776 100644
--- a/lib/action_cable/server/base.rb
+++ b/lib/action_cable/server/base.rb
@@ -1,3 +1,5 @@
+require 'em-hiredis'
+
module ActionCable
module Server
# A singleton ActionCable::Server instance is available via ActionCable.server. It's used by the rack process that starts the cable server, but
diff --git a/lib/action_cable/server/broadcasting.rb b/lib/action_cable/server/broadcasting.rb
index 037b98951e..6e0fbae387 100644
--- a/lib/action_cable/server/broadcasting.rb
+++ b/lib/action_cable/server/broadcasting.rb
@@ -1,3 +1,5 @@
+require 'redis'
+
module ActionCable
module Server
# Broadcasting is how other parts of your application can send messages to the channel subscribers. As explained in Channel, most of the time, these
@@ -44,9 +46,9 @@ module ActionCable
def broadcast(message)
server.logger.info "[ActionCable] Broadcasting to #{broadcasting}: #{message}"
- server.broadcasting_redis.publish broadcasting, message.to_json
+ server.broadcasting_redis.publish broadcasting, ActiveSupport::JSON.encode(message)
end
end
end
end
-end \ No newline at end of file
+end
diff --git a/lib/action_cable/server/configuration.rb b/lib/action_cable/server/configuration.rb
index 315782ec3e..b22de273b8 100644
--- a/lib/action_cable/server/configuration.rb
+++ b/lib/action_cable/server/configuration.rb
@@ -1,3 +1,5 @@
+require 'active_support/core_ext/hash/indifferent_access'
+
module ActionCable
module Server
# An instance of this configuration object is available via ActionCable.server.config, which allows you to tweak the configuration points
diff --git a/lib/action_cable/server/worker.rb b/lib/action_cable/server/worker.rb
index 91496775b8..e063b2a2e1 100644
--- a/lib/action_cable/server/worker.rb
+++ b/lib/action_cable/server/worker.rb
@@ -1,3 +1,6 @@
+require 'celluloid'
+require 'active_support/callbacks'
+
module ActionCable
module Server
# Worker used by Server.send_async to do connection work in threads. Only for internal use.
@@ -36,4 +39,4 @@ module ActionCable
end
end
end
-end \ No newline at end of file
+end