celluloid_pubsub 0.4.2 → 0.4.3

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: 0b23ee325d6d5abfd40a9e7dd38f0d88ff95de88
4
- data.tar.gz: 812bfd3a1a69af1aab5f9584a18572d212cfd69b
3
+ metadata.gz: a4b70569e7f3f0e1e118f5b5f14ad6e222f0d0eb
4
+ data.tar.gz: 3a65d8be43ea583f8ad71426f18ac228eaa2c7b8
5
5
  SHA512:
6
- metadata.gz: b5623b91e9118535ab1306128732e5e3f6d941a5e1dde942ff5f6e67c41e1a0b9fef5bf9ec23827051cbea26f76728f3c3de9ece08d2fcc8f1ed96fdb7c60f81
7
- data.tar.gz: 6a0618d73b49ce7ecbf1272d0e5cce783e0d4c86842b6d500f8d834c8f6ec338b4162c1cf989fc985853db8bc3e5035bf79973afce3e44dffba66f5b725343f1
6
+ metadata.gz: 1c0190d1d7d247936d3d4f65ec6a2d379b05e829085123f91ee293285e50b7ca9edc5b7573ea642d80167c9fa8bc7889456038d0a2bb4e65d44ba40de26c4d5f
7
+ data.tar.gz: d3c5eef75fe9625158225832cbb1f69daca2b58f5dc54aed17ba2cb2203003f92c1f0b79429b871191008924a100f85d681f67bca4378251b9717d2c7ff04dca
@@ -6,7 +6,6 @@ debug_enabled = ENV['DEBUG'].present? && ENV['DEBUG'].to_s == 'true'
6
6
  use_redis = ENV['USE_REDIS'].present? && ENV['USE_REDIS'].to_s == 'true'
7
7
  log_file_path = File.join(File.expand_path(File.dirname(__FILE__)), 'log', 'celluloid_pubsub.log')
8
8
 
9
-
10
9
  # actor that subscribes to a channel
11
10
  class Subscriber
12
11
  include Celluloid
@@ -183,7 +183,7 @@ module CelluloidPubsub
183
183
  # @api private
184
184
  def redis_action(action, channel = nil, message = {})
185
185
  fetch_pubsub do |pubsub|
186
- callback = prepare_redis_action(action)
186
+ callback = prepare_redis_action(pubsub, action)
187
187
  success_message = action_success(action, channel, message)
188
188
  subscription = pubsub.send(action, channel, callback)
189
189
  register_subscription_callbacks(subscription, action, success_message)
@@ -199,7 +199,7 @@ module CelluloidPubsub
199
199
  # @return [void]
200
200
  #
201
201
  # @api private
202
- def prepare_redis_action(action)
202
+ def prepare_redis_action(pubsub, action)
203
203
  log_unsubscriptions(pubsub)
204
204
  proc do |subscribed_message|
205
205
  action_subscribe?(action) ? (@websocket << subscribed_message) : log_debug(message)
@@ -17,7 +17,7 @@ module CelluloidPubsub
17
17
  # minor release version
18
18
  MINOR = 4
19
19
  # tiny release version
20
- TINY = 2
20
+ TINY = 3
21
21
  # prelease version ( set this only if it is a prelease)
22
22
  PRE = nil
23
23
 
@@ -24,7 +24,7 @@ module CelluloidPubsub
24
24
  # The request path that the webserver accepts by default
25
25
  PATH = '/ws'
26
26
 
27
- attr_accessor :options, :subscribers
27
+ attr_accessor :server_options, :subscribers
28
28
  finalizer :shutdown
29
29
  # receives a list of options that are used to configure the webserver
30
30
  #
@@ -41,7 +41,7 @@ module CelluloidPubsub
41
41
  # :nocov:
42
42
  def initialize(options = {})
43
43
  Celluloid.boot unless Celluloid.running?
44
- @options = parse_options(options)
44
+ @server_options = parse_options(options)
45
45
  @subscribers = {}
46
46
  setup_celluloid_logger
47
47
  log_debug "CelluloidPubsub::WebServer example starting on #{hostname}:#{port}"
@@ -55,7 +55,7 @@ module CelluloidPubsub
55
55
  #
56
56
  # @api public
57
57
  def use_redis
58
- @use_redis ||= @options.fetch('use_redis', false)
58
+ @use_redis = @server_options.fetch('use_redis', false)
59
59
  end
60
60
 
61
61
  # the method will return true if debug is enabled otherwise false
@@ -65,7 +65,7 @@ module CelluloidPubsub
65
65
  #
66
66
  # @api public
67
67
  def debug_enabled?
68
- @debug_enabled = @options.fetch('enable_debug', false)
68
+ @debug_enabled = @server_options.fetch('enable_debug', false)
69
69
  @debug_enabled == true
70
70
  end
71
71
 
@@ -87,7 +87,7 @@ module CelluloidPubsub
87
87
  #
88
88
  # @api public
89
89
  def log_file_path
90
- @log_file_path ||= @options.fetch('log_file_path', nil)
90
+ @log_file_path = @server_options.fetch('log_file_path', nil)
91
91
  end
92
92
 
93
93
  # the method will return the hostname on which the server is running on
@@ -97,7 +97,7 @@ module CelluloidPubsub
97
97
  #
98
98
  # @api public
99
99
  def hostname
100
- @hostname ||= @options.fetch('hostname', CelluloidPubsub::WebServer::HOST)
100
+ @hostname = @server_options.fetch('hostname', CelluloidPubsub::WebServer::HOST)
101
101
  end
102
102
 
103
103
  # the method will return the port on which will accept connections
@@ -107,7 +107,7 @@ module CelluloidPubsub
107
107
  #
108
108
  # @api public
109
109
  def port
110
- @port ||= @options.fetch('port', CelluloidPubsub::WebServer::PORT)
110
+ @port = @server_options.fetch('port', CelluloidPubsub::WebServer::PORT)
111
111
  end
112
112
 
113
113
  # the method will return the URL path on which will acceept connections
@@ -117,7 +117,7 @@ module CelluloidPubsub
117
117
  #
118
118
  # @api public
119
119
  def path
120
- @path ||= @options.fetch('path', CelluloidPubsub::WebServer::PATH)
120
+ @path = @server_options.fetch('path', CelluloidPubsub::WebServer::PATH)
121
121
  end
122
122
 
123
123
  # the method will return true if connection to the server should be spied upon
@@ -127,7 +127,7 @@ module CelluloidPubsub
127
127
  #
128
128
  # @api public
129
129
  def spy
130
- @spy ||= @options.fetch('spy', false)
130
+ @spy = @server_options.fetch('spy', false)
131
131
  end
132
132
 
133
133
  # the method will return the number of connections allowed to the server
@@ -137,7 +137,7 @@ module CelluloidPubsub
137
137
  #
138
138
  # @api public
139
139
  def backlog
140
- @backlog = @options.fetch('backlog', 1024)
140
+ @backlog = @server_options.fetch('backlog', 1024)
141
141
  end
142
142
 
143
143
  # the method will return true if redis is enabled otherwise false
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: celluloid_pubsub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - bogdanRada
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-30 00:00:00.000000000 Z
11
+ date: 2016-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: celluloid