Simplify if/else in Azure function invoker
This commit is contained in:
@@ -129,10 +129,10 @@ public class FunctionInvoker<I, O> {
|
||||
|
||||
Object functionResult = function.apply(enhancedInput);
|
||||
|
||||
if (!(functionResult instanceof Publisher)) {
|
||||
return postProcessImperativeFunctionResult(input, enhancedInput, functionResult, function, executionContext);
|
||||
if (functionResult instanceof Publisher) {
|
||||
return postProcessReactiveFunctionResult(input, enhancedInput, (Publisher<?>) functionResult, function, executionContext);
|
||||
}
|
||||
return postProcessReactiveFunctionResult(input, enhancedInput, (Publisher<?>) functionResult, function, executionContext);
|
||||
return postProcessImperativeFunctionResult(input, enhancedInput, functionResult, function, executionContext);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user