manfred-kaiser / business-rule-engine

Python DSL for setting up business intelligence rules
GNU General Public License v3.0
69 stars 21 forks source link

Added support for async actions #11

Closed earthedalien closed 3 years ago

earthedalien commented 3 years ago

I have made following improvements:

  1. async actions
  2. multiple actions with "then" ladder
  3. readme updated for above
manfred-kaiser commented 3 years ago

Thanks for the contribution, but your changes are breaking existing code because they are note backwards compatible.

Please ensure, that the checks are running without errors. I'm using pytest for unit tests.

earthedalien commented 3 years ago

Manfred,

Thanks for your quick review, for backwards compatibility, we create separate execute_async method and all other methods it uses as async. Thus execute and execute_async both can be used. Please share your comments on this.

I will add separate example for execute_async in readme.

manfred-kaiser commented 3 years ago

By checking your code, I found some another breaking changes.

Actions are not compiled:

By running the action method, the action needs to get compiled, because they can also include rules.

run_action method is static

You defined run_action as a static method. Does this method run without errors?

for action in self.actions:

In this case "self.actions" is not defined. Because self is a reference to the class and not the instance.

I will close this pull request, because of the errors and incompatibility. you can rewrite you code and if the unit tests are successful, you can open a new pull request.