-
Notifications
You must be signed in to change notification settings - Fork 283
停止标志位
rencalo770 edited this page Feb 9, 2021
·
1 revision
某些业务场景有这种需求:
- 如在使用顺序模式执行规则的场景,有规则"1","2","3","4","5","6",当用户执行了规则"2"之后,不想继续执行后面的规则.
- 如在使用混合模式执行规则的场景,有规则"1","2","3","4","5","6",其中规则"1"的优先级最高,剩下的规则优先级都比"1"低,当用户执行了"1"之后,不想继续执行后面的规则.
- 针对以上需求,或者基于性能考量,gengine支持用户使用StopTag的方式,来满足以上两种场景的需求.
func (g *Gengine) ExecuteWithStopTagDirect(rb *builder.RuleBuilder, b bool, sTag *Stag) error- 测试用例:https://github.com/bilibili/gengine/blob/main/test/stop_tag_test/stop_tag_in_sort_model_test.go
func (g *Gengine) ExecuteMixModelWithStopTagDirect(rb * builder.RuleBuilder, sTag *Stag)