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

Add support for Mono.fromRunnable(Runnable): Mono<T> generic inference #686

Closed
gregturn opened this issue Jun 28, 2017 · 0 comments
Closed
Labels
type/enhancement A general enhancement warn/api-change Breaking change with compilation errors
Milestone

Comments

@gregturn
Copy link

Add additional inference to support returning a Mono.empty based on return type.

That way this...

@Override
public Mono<MongoSession> findById(String id) {

	return findSession(id)
		.map(document -> convertToSession(this.mongoSessionConverter, document))
		.filter(mongoSession -> !mongoSession.isExpired())
		.switchIfEmpty(Mono.defer(() -> delete(id).then(Mono.empty())));
}

can be come this...

@Override
public Mono<MongoSession> findById(String id) {

	return findSession(id)
		.map(document -> convertToSession(this.mongoSessionConverter, document))
		.filter(mongoSession -> !mongoSession.isExpired())
		.switchIfEmpty(Mono.defer(() -> delete(id).then());
}
@gregturn gregturn changed the title Add support for Mono.fromRunnable(Mono<T>> generic inference Add support for Mono.fromRunnable(Mono<T>) generic inference Jun 28, 2017
@smaldini smaldini added warn/api-change Breaking change with compilation errors type/enhancement A general enhancement labels Jun 28, 2017
@smaldini smaldini added this to the 3.1.0.M3 milestone Jun 28, 2017
@smaldini smaldini changed the title Add support for Mono.fromRunnable(Mono<T>) generic inference Add support for Mono.fromRunnable(Runnable): Mono<T> generic inference Jun 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement A general enhancement warn/api-change Breaking change with compilation errors
Projects
None yet
Development

No branches or pull requests

2 participants