Giter Club home page Giter Club logo

Comments (4)

whki avatar whki commented on July 22, 2024

config.OnDebug 可以实现你说的需求,每个节点的流入和流出都会触发一次该回调函数。
文档:https://rulego.cc/pages/d59341/#ondebug

示例:

config.OnDebug = func(chainId,flowType string, nodeId string, msg types.RuleMsg, relationType string, err error) {
//每个节点执行情况的回调,包括节点、所属规则链ID、输入msg、输出msg、和下一个节点的链接关系
	}
ruleEngine, err = rulego.New("rule01", []byte(chainJsonFile1), rulego.WithConfig(config))

from rulego.

fnoopv avatar fnoopv commented on July 22, 2024

符合但不是完全符合,比如时间信息,要想从这个方法里面拿到时间信息就需要节点主动传递,我们设计上是允许用户自定义节点的,这样的情况下就没办法保证这个情况。

from rulego.

whki avatar whki commented on July 22, 2024

你说的是耗时吗?时间不需要主动传递。每个节点都会触发2次这个回调函数,分别是IN和OUT。同一个msg id IN 过程记录Start时间,OUT过程再记录End时间,这两个数之差就是这个节点该消息的执行耗时。

from rulego.

fnoopv avatar fnoopv commented on July 22, 2024

收到,谢谢

from rulego.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.