MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / next

Method next

packages/message/message_queue.ts:139–150  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

137 let index = 0;
138
139 const next = async (): Promise<void> => {
140 if (index < this.middlewares.length) {
141 const middleware = this.middlewares[index++];
142 const result = middleware(fullTopic, message, next);
143 if (result instanceof Promise) {
144 await result;
145 }
146 } else {
147 // 所有中间件都执行完毕,执行最终的处理函数
148 handler(message);
149 }
150 };
151
152 await next();
153 };

Callers

nothing calls this directly

Calls 1

handlerFunction · 0.70

Tested by

no test coverage detected