Skip to content

DATAREDIS-999 - Use UsingWhen to apply functions to reactive Redis connections #461

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
wants to merge 2 commits into from

Conversation

mp911de
Copy link
Member

@mp911de mp911de commented Jun 28, 2019

We now use Flux.usingWhen(…) to apply functions on reactive Redis connections and to release connections calling non-blocking methods.


Related ticket: DATAREDIS-999.


return Flux.from(postProcessResult(result, connToUse, false)).doFinally(signal -> conn.close());
}, ReactiveRedisConnection::closeLater, ReactiveRedisConnection::closeLater);

Choose a reason for hiding this comment

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

Is it really nonblocking call?
I see that ReactiveRedisConnection::closeLater returns Mono, but inside LettuceReactiveRedisConnection it uses call marked as blocking


There are situations when Subscription could be canceled in non blocking thread and this code will block nonblocking thread.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. That's fixed now.

@mp911de mp911de force-pushed the issue/DATAREDIS-999 branch from 2131f0c to feed7b6 Compare June 28, 2019 15:25
…nnections.

We now use Flux.usingWhen() to apply functions on reactive Redis connections and to release connections calling non-blocking methods.
@mp911de mp911de force-pushed the issue/DATAREDIS-999 branch from feed7b6 to 766bd8b Compare June 29, 2019 16:00
@mp911de
Copy link
Member Author

mp911de commented Jun 29, 2019

Connections are used either for data or pub/sub. Using both aspects does not happen in Spring Data Redis's support. However, someone could still invoke pub/sub and data operations on the same LettuceReactiveRedisConnection so it makes sense to switch to mergeDelayError(…).

christophstrobl pushed a commit that referenced this pull request Jul 2, 2019
…nnections.

We now use Flux.usingWhen() to apply functions on reactive Redis connections and to release connections calling non-blocking methods.

Original Pull Request: #461
@christophstrobl christophstrobl deleted the issue/DATAREDIS-999 branch July 2, 2019 12:30
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.

3 participants