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

Set of standard producers and updated queue implementations with some #2963

Merged
merged 2 commits into from May 19, 2015

Conversation

akarnokd
Copy link
Member

platform-safe variants.

@akarnokd akarnokd force-pushed the StandardProducers branch 2 times, most recently from 16af514 to 2ebde5e Compare May 19, 2015 10:36
long requested;
Producer currentProducer;

boolean emitting;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we could spruce up this class with the naming. This class doesn't emit anything, the emit loop actually performs requests so is a request loop (which may induce emissions elsewhere perhaps but I don't think that justifies the use of emit).

Perhaps emitting -> busy or requesting and emitLoop->requestLoop

Copy link
Member Author

Choose a reason for hiding this comment

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

It's named after the emitter-loop pattern and I'd like to keep it named this way so developers can recognize it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah I noticed the naming pattern from your blogs and I think instead of a queue drainer and an emitter they are better described as both queue drainers except one is aysnc biased and the other is sync biased.

* The queue is initialized with a stub node which is set to both the producer and consumer node references. From this
* point follow the notes on offer/poll.
*
* @author nitsanw
Copy link
Member

Choose a reason for hiding this comment

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

If we are copying this from somewhere I think we should include the URL to where it came from and associated copyright information.

@benjchristensen
Copy link
Member

This looks like good additions. If I understand correctly there are two things happening here:

  1. Abstract Producers to simplify building Observables/Operators
  2. New impls of queues that use Atomics rather than Unsafe so they work on Android, Google App Engine, etc?

The only thing I would like changed before merging is to include correct attribution to where the code comes from.

@akarnokd
Copy link
Member Author

Sure, I'll add the link. These aren't all the android-compatible variants so I plan to do a separate PR on the remaining and updating all platform-checked places.

@benjchristensen
Copy link
Member

I plan to do a separate PR on the remaining and updating all platform-checked places.

Then should the producers and queues be separated into different PRs?

@akarnokd
Copy link
Member Author

The default constructor of QueuedProducer uses SpscLinkedQueue so at least they need to be in the same PR, but MpscLinkedQueue can be added after if you wish.

@benjchristensen
Copy link
Member

Since these don't change any existing code and are all internal, let's merge and move forward.

@benjchristensen benjchristensen mentioned this pull request May 19, 2015
@akarnokd
Copy link
Member Author

Okay.

benjchristensen added a commit that referenced this pull request May 19, 2015
Set of standard producers and updated queue implementations with some
@benjchristensen benjchristensen merged commit 03332a2 into 1.x May 19, 2015
@benjchristensen benjchristensen deleted the StandardProducers branch May 19, 2015 18:52
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

Successfully merging this pull request may close these issues.

None yet

3 participants