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

Replace IEnumerable<IFunction> to IEnumerable<FunctionMetaData> instead #47

Closed
thygesteffensen opened this issue Aug 31, 2021 · 2 comments · Fixed by #76
Closed

Replace IEnumerable<IFunction> to IEnumerable<FunctionMetaData> instead #47

thygesteffensen opened this issue Aug 31, 2021 · 2 comments · Fixed by #76
Labels

Comments

@thygesteffensen
Copy link
Member

thygesteffensen commented Aug 31, 2021

In ExpressionRule.cs use metadata and service provider to resolve functions, instead of resolving every function. Prior, functions were cheap to create due to their simple logic, new functions may contain HTTP clients or DB clients, which are more expensive to create. To make it faster and lighter, we can instead use mete data classes to locate a function and resolve it. See AddPlugin

@thygesteffensen thygesteffensen changed the title Replace List<IFunction> to List<FunctionMetaData> instead Replace IEnumerable<IFunction> to IEnumerable<FunctionMetaData> instead Aug 31, 2021
@thygesteffensen thygesteffensen added good first issue Good for newcomers enhancement New feature or request labels Aug 31, 2021
thygesteffensen added a commit that referenced this issue Feb 28, 2022
FunctionMetadata.cs have been added to make it easier to add function aliases and make the function part lighter.
Added FunctionMetadata.cs makes it possible to register a function on multiple aliases. Furthermore, only the FunctionMetadata class is retrieved as a list from DI, thus not building the function before it is actually needed, making room for more heavy dependencies, without making the entire engine slow.

Resolved #47, Resolved #58. Still need to clean up.
@thygesteffensen thygesteffensen linked a pull request Feb 28, 2022 that will close this issue
@github-actions
Copy link

🎉 This issue has been resolved in version 4.0.0-dev.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This issue has been resolved in version 4.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant