Skip to content

Commit 253a67a

Browse files
committed
Added deprecation notes to Actor, Channel, and Postable.
1 parent a43611a commit 253a67a

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

lib/concurrent/actor.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ module Concurrent
119119
#
120120
# ping << :pong
121121
#
122+
# @deprecated +Actor+ is being replaced with a completely new framework prior to v1.0.0
123+
#
122124
# @see http://ruby-doc.org/stdlib-2.0/libdoc/observer/rdoc/Observable.html
123125
class Actor
124126
include Observable
@@ -174,6 +176,8 @@ def initialize(queue)
174176
# #=> [6] handled by #<EchoActor:0x007fc8014fb8b8>
175177
# #=> [7] handled by #<EchoActor:0x007fc8014fb818>
176178
# #=> [8] handled by #<EchoActor:0x007fc8014fb890>
179+
#
180+
# @deprecated +Actor+ is being replaced with a completely new framework prior to v1.0.0
177181
def self.pool(count, *args, &block)
178182
raise ArgumentError.new('count must be greater than zero') unless count > 0
179183
mailbox = Queue.new
@@ -202,24 +206,32 @@ def self.pool(count, *args, &block)
202206
# @return [Object] the result obtained when the message is successfully processed
203207
#
204208
# @raise NotImplementedError unless overridden in the +Actor+ subclass
209+
#
210+
# @deprecated +Actor+ is being replaced with a completely new framework prior to v1.0.0
205211
#
206212
# @!visibility public
207213
def act(*message)
208214
raise NotImplementedError.new("#{self.class} does not implement #act")
209215
end
210216

211217
# @!visibility private
218+
#
219+
# @deprecated +Actor+ is being replaced with a completely new framework prior to v1.0.0
212220
def on_run # :nodoc:
213221
queue.clear
214222
end
215223

216224
# @!visibility private
225+
#
226+
# @deprecated +Actor+ is being replaced with a completely new framework prior to v1.0.0
217227
def on_stop # :nodoc:
218228
queue.clear
219229
queue.push(:stop)
220230
end
221231

222232
# @!visibility private
233+
#
234+
# @deprecated +Actor+ is being replaced with a completely new framework prior to v1.0.0
223235
def on_task # :nodoc:
224236
package = queue.pop
225237
return if package == :stop
@@ -247,6 +259,8 @@ def on_task # :nodoc:
247259
end
248260

249261
# @!visibility private
262+
#
263+
# @deprecated +Actor+ is being replaced with a completely new framework prior to v1.0.0
250264
def on_error(time, msg, ex) # :nodoc:
251265
end
252266
end

lib/concurrent/channel.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ module Concurrent
3030
# future.fulfilled? => true
3131
#
3232
# channel.stop => true
33+
#
34+
# @note +Actor+ is being replaced with a completely new framework prior to v1.0.0.
35+
# Subsequently +Channel+ will be rewritten to no longer inherit from +Actor+
36+
# and no longer include +Stoppable+. The +forward+ method from +Postable+
37+
# will also be deprecated. The +pool+ method will likely be removed as
38+
# well (in lieu of an internal thread pool). The other messaging methods
39+
# (+post+, +post?+, and +post!+) will remain and will behave as they do
40+
# now.
3341
#
3442
# @see http://blogs.msdn.com/b/dsyme/archive/2010/02/15/async-and-parallel-design-patterns-in-f-part-3-agents.aspx Async and Parallel Design Patterns in F#: Agents
3543
# @see http://msdn.microsoft.com/en-us/library/ee370357.aspx Control.MailboxProcessor<'Msg> Class (F#)

lib/concurrent/postable.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,15 @@ def post!(seconds, *message)
7575
end
7676
end
7777

78+
# @deprecated +Actor+ is being replaced with a completely new framework prior to v1.0.0
7879
def forward(receiver, *message)
7980
raise ArgumentError.new('empty message') if message.empty?
8081
return false unless ready?
8182
queue.push(Package.new(message, receiver))
8283
queue.length
8384
end
8485

86+
# @deprecated +Actor+ is being replaced with a completely new framework prior to v1.0.0
8587
def ready?
8688
if self.respond_to?(:running?) && ! running?
8789
false

0 commit comments

Comments
 (0)