feeding nools facts until halt

198 views
Skip to first unread message

Brian Thibault

unread,
Dec 27, 2013, 5:20:22 PM12/27/13
to no...@googlegroups.com
Right now I'm asserting all my facts at once, which load them all up into memory I'm assuming, and I could have upwards of a million facts

What I want to do is something like -- 

flow.getSession().matchUntilHalt(function(err){
    if(err){
        console.log(err.stack);
        return;
    }
     myFacts.forEach(function(newFact){
         session.assert(newFact);
         // do match now
});
  halt(); 
    //halt finally invoked
});

Douglas Martin

unread,
Dec 30, 2013, 12:28:17 PM12/30/13
to no...@googlegroups.com
When you invoke matchUntilHalt the callback you provide will not be called until halt is called on the current session. 

Are you wanting stream facts into the session and once you are done inserting facts have the session halt once all rules have executed?

-Doug

Brian Thibault

unread,
Dec 30, 2013, 12:30:20 PM12/30/13
to no...@googlegroups.com
Exactly

Douglas Martin

unread,
Dec 30, 2013, 12:33:29 PM12/30/13
to no...@googlegroups.com
Ok, this is a feature that is not currently supported however I think it would be a great addition. I will create an issue on github and hopefully get to it soon.

-Doug
Reply all
Reply to author
Forward
0 new messages