You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What are your thoughts on adding a CancellationToken argument in Session.Fire()? This would be to allow the execution to halt if it's taking too long (likely infinitely looping due to chaining).
It seems a check to actionContext.IsHalted is already checked in each iteration, so i'm sure the two could somehow be merged if efficiency is a problem.
I think long running actions could be handled by exposing the cancellation token on IContext which would only leave potential gaps if the matching process/RETE maintenance is slow and not cancellable.
The text was updated successfully, but these errors were encountered:
@a046 I think this is a reasonable improvement.
For Fire method itself, you could just call Fire(1) in a loop and bail out if you get too many cycles. But it does not help with long-running actions, so I think your proposal makes sense.
Just another thought, a comprehensive solution might also support/check the CancellationToken in RuleCompiler.Compile as that could be a slow/costly part.
Maybe also InsertAll for the initial seeding of the engine with facts? Unless you'd recommend calling Insert in a loop externally.
What are your thoughts on adding a CancellationToken argument in Session.Fire()? This would be to allow the execution to halt if it's taking too long (likely infinitely looping due to chaining).
It seems a check to actionContext.IsHalted is already checked in each iteration, so i'm sure the two could somehow be merged if efficiency is a problem.
I think long running actions could be handled by exposing the cancellation token on IContext which would only leave potential gaps if the matching process/RETE maintenance is slow and not cancellable.
The text was updated successfully, but these errors were encountered: