Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

observable? predicate fails on the results of ignore #37

Closed
jconti opened this issue Oct 9, 2017 · 5 comments
Closed

observable? predicate fails on the results of ignore #37

jconti opened this issue Oct 9, 2017 · 5 comments

Comments

@jconti
Copy link
Contributor

jconti commented Oct 9, 2017

This makes sense to me:

(rx/observable? (rx/just 1)) => true
(rx/observable? (rx/empty)) => true

But this does not:

(rx/observable? (rx/ignore (rx/just 1))) => false
@jconti
Copy link
Contributor Author

jconti commented Oct 10, 2017

Apologies I did not mention the environment:

Clojure 1.8.0
Java 1.8.0_144 runtime
beicon 4.0.0

@jconti
Copy link
Contributor Author

jconti commented Oct 10, 2017

And some additional info:

user> (type (rx/ignore (rx/just 1)))
io.reactivex.internal.operators.observable.ObservableIgnoreElementsCompletable
user> (ancestors (class (rx/ignore (rx/just 1))))
#{io.reactivex.CompletableSource 
  io.reactivex.Completable 
  io.reactivex.internal.fuseable.FuseToObservable 
  java.lang.Object}
user> (type (rx/empty))
io.reactivex.internal.operators.observable.ObservableEmpty
user> (ancestors (class (rx/empty)))
#{java.util.concurrent.Callable
  io.reactivex.internal.fuseable.ScalarCallable
  io.reactivex.ObservableSource 
  java.lang.Object
  io.reactivex.Observable}
user> (type (rx/just 1))
io.reactivex.internal.operators.observable.ObservableJust
user> (ancestors (class (rx/just 1)))
#{java.util.concurrent.Callable
  io.reactivex.internal.fuseable.ScalarCallable
  io.reactivex.ObservableSource 
  java.lang.Object
  io.reactivex.Observable}

Maybe this suggests (observable?) should test for membership in a couple of interfaces.

@jconti
Copy link
Contributor Author

jconti commented Oct 10, 2017

One more note. Found with code like the following (emit the second observable iff the first completes):

user> (rx/concat (rx/ignore (rx/just 1)) (rx/just 2))
ExceptionInfo Invalid arguments.  clojure.core/ex-info (core.clj:4617)
user> *e
#error {
 :cause "Invalid arguments."
 :data {}
 :via
 [{:type clojure.lang.ExceptionInfo
   :message "Invalid arguments."
   :data {}
   :at [clojure.core$ex_info invokeStatic "core.clj" 4617]}]
 :trace
 [[clojure.core$ex_info invokeStatic "core.clj" 4617]
  [clojure.core$ex_info invoke "core.clj" 4617]
  [beicon.core$concat invokeStatic "core.cljc" 867]
  [beicon.core$concat doInvoke "core.cljc" 851]
  [clojure.lang.RestFn invoke "RestFn.java" 421]
  [user$eval42033 invokeStatic "form-init1769356671242240218.clj" 9990]
  [user$eval42033 invoke "form-init1769356671242240218.clj" 9990]
  [clojure.lang.Compiler eval "Compiler.java" 6927]
  [clojure.lang.Compiler eval "Compiler.java" 6890]
  [clojure.core$eval invokeStatic "core.clj" 3105]
  [clojure.core$eval invoke "core.clj" 3101]
  [clojure.main$repl$read_eval_print__7408$fn__7411 invoke "main.clj" 240]
  [clojure.main$repl$read_eval_print__7408 invoke "main.clj" 240]
  [clojure.main$repl$fn__7417 invoke "main.clj" 258]
  [clojure.main$repl invokeStatic "main.clj" 258]
  [clojure.main$repl doInvoke "main.clj" 174]
  [clojure.lang.RestFn invoke "RestFn.java" 1523]
  [clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__18321 invoke "interruptible_eval.clj" 87]
  [clojure.lang.AFn applyToHelper "AFn.java" 152]
  [clojure.lang.AFn applyTo "AFn.java" 144]
  [clojure.core$apply invokeStatic "core.clj" 646]
  [clojure.core$with_bindings_STAR_ invokeStatic "core.clj" 1881]
  [clojure.core$with_bindings_STAR_ doInvoke "core.clj" 1881]
  [clojure.lang.RestFn invoke "RestFn.java" 425]
  [clojure.tools.nrepl.middleware.interruptible_eval$evaluate invokeStatic "interruptible_eval.clj" 85]
  [clojure.tools.nrepl.middleware.interruptible_eval$evaluate invoke "interruptible_eval.clj" 55]
  [clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__18366$fn__18369 invoke "interruptible_eval.clj" 222]
  [clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__18361 invoke "interruptible_eval.clj" 190]
  [clojure.lang.AFn run "AFn.java" 22]
  [java.util.concurrent.ThreadPoolExecutor runWorker "ThreadPoolExecutor.java" 1142]
  [java.util.concurrent.ThreadPoolExecutor$Worker run "ThreadPoolExecutor.java" 617]
  [java.lang.Thread run "Thread.java" 745]]}

niwinz added a commit that referenced this issue Nov 17, 2017
@niwinz
Copy link
Member

niwinz commented Nov 17, 2017

This issue is now fixed in 4.1.0

@niwinz niwinz closed this as completed Nov 17, 2017
@jconti
Copy link
Contributor Author

jconti commented Nov 20, 2017

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants