dreamhead / moco

Easy Setup Stub Server
MIT License
4.37k stars 1.08k forks source link

How to configure multiple events for one request. #347

Open comeCU opened 2 months ago

comeCU commented 2 months ago

One request triggers multiple event callbacks.

my config like this, but only one will work.

[
  {
    "description":"异步事件1",
    "request":{
      "uri":"/eventAsync",
      "method":"get"
    },
    "response":{
      "text":"eventeventAsync ..."
    },
    "on":{
      "complete":{
        "async":"true",
        "latency":3000,
        "get" : {
          "url":"http://test-mysite/eventAsync01"
        }
      }
    }
  },
  {
    "description":"异步事件2",
    "request":{
      "uri":"/eventAsync",
      "method":"get"
    },
    "response":{
      "text":"eventeventAsync 2 ..."
    },
    "on":{
      "complete":{
        "async":"true",
        "latency":5000,
        "get" : {
          "url":"http://test-mysite/eventAsync02"
        }
      }
    }
  }
]
ComeonBug commented 2 months ago

这是来自QQ邮箱的假期自动回复邮件。你好,我最近正在休假中,无法亲自回复你的邮件。我将在假期结束后,尽快给你回复。