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

provides supportive class to hide concurrency complexity #807

Merged
merged 7 commits into from
May 1, 2020

Conversation

OlegDokuka
Copy link
Member

@OlegDokuka OlegDokuka commented Apr 30, 2020

This PR includes extra supportive class which should be used only for requestXXX interactions via Operators.lift in order to simplify business logic inside RSocketRequester (e.g. wipLoops and cancel / request signals serialization)

Also, this PR, ensures that streamId will be generated exactly during the first request phase so we will not waste sequence in case stream was not subscribed. The same is relevant to

  private final IntObjectMap<Subscription> senders;
  private final IntObjectMap<Processor<Payload, Payload>> receivers;

holders which are going to get logical stream put in it only in case of successful subscription to the generated interaction with the subsequent request(n) call on it.

Note. StreamId should not be issued until the first requestN as well as the holders should not store anything prior to the first frame sent (it means that if cancel signal happened prior the first request, the only thing we have to do is releasing given payload)

Signed-off-by: Oleh Dokuka [email protected]

@OlegDokuka OlegDokuka added the refactorings Changes that does not affect API and behaviour label Apr 30, 2020
@OlegDokuka OlegDokuka added this to the 1.0 milestone Apr 30, 2020
@OlegDokuka OlegDokuka force-pushed the enhancement/reduce-maintanence-complexity branch from 0e716a5 to 6c4c075 Compare April 30, 2020 18:48
Copy link
Contributor

@rstoyanchev rstoyanchev left a comment

Choose a reason for hiding this comment

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

Looks good, much easier to read the request logic. Some minor changes requested.

CancelFrameFlyweight.encode(allocator, streamId));
} else {
payload.release();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice one! Avoiding the reliance on the refCnt to check if the request was sent.

OlegDokuka and others added 3 commits May 1, 2020 10:18
@OlegDokuka OlegDokuka requested a review from rstoyanchev May 1, 2020 07:25
@OlegDokuka OlegDokuka merged commit 12fd301 into develop May 1, 2020
@OlegDokuka OlegDokuka deleted the enhancement/reduce-maintanence-complexity branch May 1, 2020 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactorings Changes that does not affect API and behaviour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants