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

rename AsyncEmitter to Emitter #4580

Merged
merged 1 commit into from
Sep 24, 2016
Merged

Conversation

davidmoten
Copy link
Collaborator

as per discussion in #4577, renaming AsyncEmitter to Emitter via deprecation.

There is a catch though. CompletableEmitter is correctly named now and depends on AsyncEmitter via the method:

 void setCancellation(AsyncEmitter.Cancellable c);

When can we break the api of that class?

@akarnokd akarnokd added this to the 1.3 milestone Sep 22, 2016
@akarnokd
Copy link
Member

👍

@codecov-io
Copy link

codecov-io commented Sep 22, 2016

Current coverage is 84.57% (diff: 93.90%)

Merging #4580 into 1.x will increase coverage by 0.21%

@@                1.x      #4580   diff @@
==========================================
  Files           272        274     +2   
  Lines         17571      17807   +236   
  Methods           0          0          
  Messages          0          0          
  Branches       2683       2727    +44   
==========================================
+ Hits          14822      15060   +238   
+ Misses         1884       1880     -4   
- Partials        865        867     +2   

Powered by Codecov. Last update 646be2d...44bf8a8

@davidmoten
Copy link
Collaborator Author

Thanks for review @akarnokd . I take it we have to wait for 1.3 to break the api of experimental CompletableEmitter?

@akarnokd
Copy link
Member

Deleting experimental APIs has to wait one patch version so 1.2.1 will have both and 1.2.2 can remove the AsyncEmitter.

@davidmoten
Copy link
Collaborator Author

OK I'll patch again once 1.2.1 is out.

On Thu, 22 Sep 2016, 21:25 David Karnok notifications@github.com wrote:

Deleting experimental APIs has to wait one patch version so 1.2.1 will
have both and 1.2.2 can remove the AsyncEmitter.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#4580 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AATa67zUR0rWDCgQVUO3_lraKxmJQL9Yks5qsmWMgaJpZM4KDwhj
.

@akarnokd
Copy link
Member

/cc @JakeWharton @artem-zinnatullin

*/
@Experimental
@Deprecated
public interface AsyncEmitter<T> extends Observer<T> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could make this extend from Emitter to avoid having two implementations of the operator.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to this, otherwise I'm 👍 for renaming

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cannot extend Emitter because of two versions of Cancellable. Would break existing AsyncEmitter use.

* A functional interface that has a single close method
* that can throw.
*/
interface Cancellable {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could move this into rx.functions to decouple it from the emitter. Also CompletableEmitter needs to handle the change in some way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like a good idea to decouple. CompletableEmitter is an interface so I can't just add a method and deprecate the old one. How about I add a @Deprecated annotation to CompletableEmitter at the class level now, then after next release I remove the annotation and fix the signature of setCancellation?

@JakeWharton
Copy link
Contributor

Make the cancelable interfaces extend each other as well.

On Thu, Sep 22, 2016, 6:33 PM Dave Moten notifications@github.com wrote:

@davidmoten commented on this pull request.

In src/main/java/rx/AsyncEmitter.java
#4580:

*/
@experimental
+@deprecated
public interface AsyncEmitter extends Observer {

cannot extend Emitter because of two versions of Cancellable. Would break
existing AsyncEmitter use.


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#4580, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEEETq3YK4zRTnOQtTAGmRNbM6EIb0-ks5qswJPgaJpZM4KDwhj
.

@davidmoten
Copy link
Collaborator Author

Make the cancelable interfaces extend each other as well.

Good idea, thanks

@davidmoten
Copy link
Collaborator Author

Um I don't think it's worth it juggling with inheritance of these interfaces. Straight after next release I'm just going to delete the deprecated stuff.

@davidmoten
Copy link
Collaborator Author

I've added a @Deprecated annotation to CompletableEmitter. Let me know if you guys still want the interface inheritance business.

@davidmoten
Copy link
Collaborator Author

Forgot to move Cancellable to rx.functions. That's done now.

/**
* A functional interface that has a single close method that can throw.
*/
public interface Cancellable {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Experimental / since tag missing

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, ta

@akarnokd akarnokd merged commit 4328619 into ReactiveX:1.x Sep 24, 2016
@akarnokd
Copy link
Member

Thanks for working this out!

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

Successfully merging this pull request may close these issues.

None yet

5 participants