Skip to content

Why are PublishSubject, etc considered 'internal/not needed by users' in scala-lang? #469

@lossyrob

Description

@lossyrob

https://github.com/Netflix/RxJava/blob/master/language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/subjects/package.scala#L40

I have an instance in an Akka Actor where I'd like to pass back an Observable to the a client, and then manually convert messages passed to that actor as events on that observable for the client to handle. I can do this with:

val ps = PublishSubject.create[Int]()
val o = Observable(ps)

// send o to client

// on incoming message,
ps.onNext(i)

Which works fine but it seems like shows that PublishSubject can be used in a not-internal way, and I certainly would use one out of the scala-lang package instead of having to dip outside of it.

I haven't used RxJava much but I used to do this with a .NET Rx project a lot, where objects would manage observables and converting non-IObservable pattern events into events on those observables. Is there a better way to convert Akka message streams\arbitrary non-RxJava streams into Observable events that I am missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions