RuleGo RuleGo
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • RuleGo-MCP-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • RuleGo-MCP-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文

广告采用随机轮播方式显示 ❤️成为赞助商
  • Quick Start

  • Rule Chain

  • Standard Components

  • Extension Components

  • Custom Components

  • Components marketplace

  • Visualization

  • AOP

  • Trigger

  • Advanced Topic

    • Config
    • Options
    • Share data
    • Execute Rule Chain
      • Component Configuration Variables
      • Component Connection Reuse
      • Performance
      • Other
    • RuleGo-Server

    • FAQ

    • Endpoint Module

    • Support

    目录

    Execute Rule Chain

    # Asynchronous Execution of Rule Chain

    Does not block the parent process. You can listen for the end through types.WithOnEnd or types.WithOnAllNodeCompleted. The usage is as follows:

    ruleEngine, ok := rulego.Get("rule-01")
    ruleEngine.OnMsg(msg, opts ...types.RuleContextOption)
    
    1
    2

    # Synchronous Execution of Rule Chain

    Blocks the parent process, and will not proceed until all nodes of the rule chain have completed execution. The usage is as follows:

    ruleEngine, ok := rulego.Get("rule-01")
    ruleEngine.OnMsgAndWait(msg, opts ...types.RuleContextOption)
    
    1
    2

    This meets the use case where it is necessary to return to the parent process. If this scenario is not required, use the asynchronous call method.

    # RuleContextOption

    Reference: options

    Edit this page on GitHub (opens new window)
    Last Updated: 2025/04/02, 01:29:50
    Share data
    Component Configuration Variables

    ← Share data Component Configuration Variables→

    Theme by Vdoing | Copyright © 2023-2025 RuleGo Team | Apache 2.0 License

    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式