action_cable_subscription_adapter 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a21082ad56c100816a94a8372b270b5e93f466fd
|
4
|
+
data.tar.gz: 558e5cf2ca40cfa1e97dd56bcf646fb8b1b3b343
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74d135a770b5457c3be1595238726a5cf132194b72dec5faf5bfb94308e0fbb9850fa406379aeff621a65387688115ff54135bc9ec72711be273552e8262d2d5
|
7
|
+
data.tar.gz: 568ddbd9285f811ce04be202b2ad1dfc98a37dbebb3db825b6c6fa0062ca25bdf757d9bed7f6bfd09b2c5b2a8ed47de082c217c0dcf381175a206b220d01a9f7
|
@@ -4,7 +4,9 @@ require "action_cable/subscription_adapter/redis"
|
|
4
4
|
module ActionCable::SubscriptionAdapter
|
5
5
|
class CustomAdapter < Redis
|
6
6
|
def redis_connector
|
7
|
-
ActionCableSubscriptionAdapter.redis_connector.call self
|
7
|
+
r=ActionCableSubscriptionAdapter.redis_connector.call self
|
8
|
+
Rails.logger.info "ActionCableSubscriptionAdapter: #{r}"
|
9
|
+
r
|
8
10
|
end
|
9
11
|
end
|
10
12
|
end
|
@@ -9,19 +9,21 @@ module ActionCableSubscriptionAdapter
|
|
9
9
|
# c.redis_connector = MyRedisClient.new
|
10
10
|
# end
|
11
11
|
#
|
12
|
-
# You can also
|
12
|
+
# You can also assign a factory block that will run when the ActionCable workers are initialized.
|
13
|
+
# The block should return your Redis client instance.
|
14
|
+
# Example:
|
13
15
|
#
|
14
16
|
# ActionCableSubscriptionAdapter.config do |c|
|
15
17
|
# c.redis_connector = ->(subscription_adapter) { MyRedisClient.new }
|
16
18
|
# end
|
17
19
|
#
|
18
|
-
# The custom Redis client needs to conform to the
|
20
|
+
# The custom Redis client needs to conform to the redis-rb gem's API.
|
19
21
|
#
|
20
22
|
mattr_accessor :redis_connector
|
21
23
|
|
22
24
|
def self.config(&block)
|
23
25
|
block.call self
|
24
|
-
@redis_connector = ->(s) {
|
26
|
+
@redis_connector = ->(s) { redis_connector } unless redis_connector.respond_to? :call
|
25
27
|
self
|
26
28
|
end
|
27
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: action_cable_subscription_adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Diego Salazar
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|