RxRuby icon indicating copy to clipboard operation
RxRuby copied to clipboard

BehaviorSubject fails due to call to private member of nested inner class InnerSubscription

Open nPn- opened this issue 8 years ago • 1 comments

The following code generates this traceback:

/var/lib/gems/2.1.0/gems/rx-0.0.3/lib/rx/subjects/behavior_subject.rb:80:in `block in on_next': private method `check_unsubscribed' called for #<Rx::BehaviorSubject:0x129b0d0> (NoMethodError)
	from /var/lib/gems/2.1.0/gems/rx-0.0.3/lib/rx/subjects/behavior_subject.rb:79:in `synchronize'
	from /var/lib/gems/2.1.0/gems/rx-0.0.3/lib/rx/subjects/behavior_subject.rb:79:in `on_next'
	from behavior_example.rb:3:in `<main>
require 'rx'
subject = Rx::BehaviorSubject.new 0
subject.on_next(0)
subject.as_observable.subscribe { puts "hello" }

when run using ruby 2.1.5p273 (2014-11-13) [arm-linux-gnueabihf]
(on a raspberrypi 3)

Is there a reason the method is marked private? It seems to work fine if I comment out the private keyword

nPn- avatar Sep 06 '17 01:09 nPn-

I suppose BehaviorSubject is not much used 😕 . Fix in #109 .

bittrance avatar Oct 21 '17 00:10 bittrance