Skip to content

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

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

Closed
lossyrob opened this issue Nov 5, 2013 · 3 comments

Comments

@lossyrob
Copy link

lossyrob commented Nov 5, 2013

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?

@benjchristensen
Copy link
Member

Probably they have just not been wrapped yet by those contributing to the scala-lang module.

Here is a blog post from @jmhofer working with Akka: http://jmhofer.johoop.de/?p=507

You can see some background on the Scala support being added here: #336 and learn more about the implementation via this presentation starting around the 52 minute mark: http://youtu.be/tOMK_FYJREw?t=52m13s

You can get involved and contribute to this module: https://github.com/Netflix/RxJava/tree/master/language-adaptors/rxjava-scala

@lossyrob
Copy link
Author

lossyrob commented Nov 6, 2013

Thanks for the resources, I'll take a look. I worked in C# for years and used Rx extensively. I'm glad to see it make it's way into scala. I'll see what I can contribute.

Cheers,
Rob

@lossyrob lossyrob closed this as completed Nov 6, 2013
@samuelgruetter
Copy link
Contributor

It's me who wrote that "PublishSubject, etc are considered internal/not needed by users", but that's wrong, please discard it.

I think @headinthebox started/wanted to start writing Scala bindings for these subjects, but I'm not sure what the status is.

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

3 participants