Open kevbite opened 7 years ago
It might be useful if the result was also passed in and could be changed by the OnExecutedAsync
on the filters too.
Looks like there's some value here - asp.net action filters appear to have a similar feature short-circuiting if result is set in a filter, we should try to mirror that behavior.
We're tracking some remaining work items for Filters in this issue https://github.com/Azure/azure-webjobs-sdk/issues/1284. For the initial set of functionality we kept things scoped to get feedback. We have it on our TODO list to look at return values from filters, and I updated the issue to also mention short circuiting so we can explore that.
I created a new tracking item here for the all up Result/Cancel feature: https://github.com/Azure/azure-webjobs-sdk/issues/1314
That's great, I look forward to the features! Thanks
Can you please provide status update?
No progress on this halfway through 2019 now?
I'm trying to create a
IFunctionInvocationFilter
but I want to be able to safely short circuit the invocation of the function from a filter and pass back a return value.It's currently possible to short circuit it by throwing an exception within the
OnExecutingAsync
method of the filter but sequential filters wont be called and the exception is bubbled up.It would be useful if within the Invocation filters to be able to set a property that allows skipping of the function execution (similar to the MVC framework)
I could throw something together and submit a PR of an example of what I mean?