Skip to content

Commit 134f620

Browse files
committed
Allow to silent experimental warning
1 parent 49417cb commit 134f620

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

lib/concurrent/actress.rb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ def on_message(message)
4242
# @param block for actress_class instantiation
4343
# @param args see {.spawn_optionify}
4444
def self.spawn(*args, &block)
45-
warn '[EXPERIMENTAL] A full release of `Actress`, renamed `Actor`, is expected in the 0.7.0 release.'
45+
experimental_acknowledged? or
46+
warn '[EXPERIMENTAL] A full release of `Actress`, renamed `Actor`, is expected in the 0.7.0 release.'
47+
4648
if Actress.current
4749
Core.new(spawn_optionify(*args).merge(parent: Actress.current), &block).reference
4850
else
@@ -52,7 +54,6 @@ def self.spawn(*args, &block)
5254

5355
# as {.spawn} but it'll raise when Actor not initialized properly
5456
def self.spawn!(*args, &block)
55-
warn '[EXPERIMENTAL] A full release of `Actress`, renamed `Actor`, is expected in the 0.7.0 release.'
5657
spawn(spawn_optionify(*args).merge(initialized: ivar = IVar.new), &block).tap { ivar.no_error! }
5758
end
5859

@@ -71,5 +72,13 @@ def self.spawn_optionify(*args)
7172
args: args[2..-1] }
7273
end
7374
end
75+
76+
def self.i_know_it_is_experimental!
77+
@experimental_acknowledged = true
78+
end
79+
80+
def self.experimental_acknowledged?
81+
!!@experimental_acknowledged
82+
end
7483
end
7584
end

spec/concurrent/actress_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
module Concurrent
55
module Actress
6+
i_know_it_is_experimental!
67
describe 'Concurrent::Actress' do
78

89
class Ping

0 commit comments

Comments
 (0)