spring-projects / spring-projects/spring-data-redis

Refine and clarify operations in asynchronous caching implementation

Open
#2,743 0 comments 0 reactions 1 assignee View on GitHub

@jxblum is already working on this.

Since Oct 26, 2023.

in: cache type: task
Dominant language
Java
Stars
1.9k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

See Issue #2650

See Original Pull Request #2717

Uses more descriptive names for operations, especially Reactive operations, by either calling a local, private method or introducing a variable with strongly typed parameters.

For example, this Function<ReactiveRedisConnection, Mono<T>> commandExecution is more readable and descriptive than it -> Mono.fromCompletionStage(callback.apply(it)) buried in some Reactive Publisher (e.g. Flux) operation. Outside of the IDE (such as reading source in GitHub), I immediately know that "it" is a Redis (Reactive) connection, that I am executing a Redis command and that I can safely assume I am getting back a Mono of T (the value returned from the "reactive" command execution).

In some case (perhaps many cases) Reactive programming obscures the actions that are actually happening (such as looping until some condition is met), particularly in "concurrent" fashion, making the code more difficult to understand. Without, proper naming and organization, understanding is greatly diminished and even readability is compromised.

Edits Javadoc.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.