-
Notifications
You must be signed in to change notification settings - Fork 39
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
Introduce FluxFromStreamSupplier
Refaster rule
#1261
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for picking up 💪
* may defer initiation of the asynchronous computation until subscription. | ||
*/ | ||
static final class FluxFromStreamSupplier<T> { | ||
@BeforeTemplate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BeforeTemplate | |
// XXX: Constrain the `stream` parameter using `@NotMatches(IsIdentityOperation.class)` once | |
// `IsIdentityOperation` no longer matches nullary method invocations. | |
@BeforeTemplate |
Is this XXX
also relevant in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a commit. Suggested commit message:
Introduce `FluxFromStreamSupplier` Refaster rule (#1261)
@@ -641,4 +643,8 @@ Mono<Void> testMonoFromFutureSupplier() { | |||
Mono<Void> testMonoFromFutureSupplierBoolean() { | |||
return Mono.fromFuture(() -> CompletableFuture.completedFuture(null), true); | |||
} | |||
|
|||
Flux<Integer> testFluxFromStreamSupplier() { | |||
return Flux.fromStream(() -> RandomGenerator.StreamableGenerator.of(1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Damn, I'm not sure what I was doing here 😬.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think something with auto-complete I'd say, but slipped through.
* may defer initiation of the asynchronous computation until subscription. | ||
*/ | ||
static final class FluxFromStreamSupplier<T> { | ||
@BeforeTemplate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is 👍
@@ -1913,7 +1914,7 @@ Duration after(StepVerifier.LastStep step, Duration duration) { | |||
|
|||
/** | |||
* Prefer {@link Mono#fromFuture(Supplier)} over {@link Mono#fromFuture(CompletableFuture)}, as | |||
* the former may defer initiation of the asynchornous computation until subscription. | |||
* the former may defer initiation of the asynchronous computation until subscription. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one; should also be fixed below.
static final class FluxFromStreamSupplier<T> { | ||
@BeforeTemplate | ||
Flux<T> before(Stream<T> stream) { | ||
return Flux.fromStream(stream); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This triggers an interaction with FluxFromIterable
, so more changes are necessary; will apply.
/** | ||
* Prefer {@link Flux#fromStream(Supplier)} over {@link Flux#fromStream(Stream)}, as the former | ||
* may defer initiation of the asynchronous computation until subscription. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to asynchronicity 👀.
/** | |
* Prefer {@link Flux#fromStream(Supplier)} over {@link Flux#fromStream(Stream)}, as the former | |
* may defer initiation of the asynchronous computation until subscription. | |
*/ | |
/** | |
* Prefer {@link Flux#fromStream(Supplier)} over {@link Flux#fromStream(Stream)}, as the former | |
* yields a {@link Flux} that is more likely to behave as expected when subscribed to more than | |
* once. | |
*/ |
Looks good. No mutations were possible for these changes. |
825d644
to
0eedcae
Compare
Looks good. No mutations were possible for these changes. |
Quality Gate passedIssues Measures |
No description provided.