类 MiddlewareChain
java.lang.Object
io.agentscope.core.middleware.MiddlewareChain
Builds an onion-style middleware chain for a given interception point.
The chain is constructed back-to-front: the last middleware wraps the core logic, and the first middleware is the outermost wrapper.
-
嵌套类概要
嵌套类修饰符和类型类说明static interfaceFunctional interface representing one of the onion-pattern middleware hooks. -
方法概要
修饰符和类型方法说明static <I> Function<I, reactor.core.publisher.Flux<AgentEvent>> build(List<? extends MiddlewareBase> middlewares, Agent agent, RuntimeContext ctx, MiddlewareChain.MiddlewareMethod<I> method, Function<I, reactor.core.publisher.Flux<AgentEvent>> core) Build a middleware chain that producesFlux<AgentEvent>.
-
方法详细资料
-
build
public static <I> Function<I,reactor.core.publisher.Flux<AgentEvent>> build(List<? extends MiddlewareBase> middlewares, Agent agent, RuntimeContext ctx, MiddlewareChain.MiddlewareMethod<I> method, Function<I, reactor.core.publisher.Flux<AgentEvent>> core) Build a middleware chain that producesFlux<AgentEvent>.- 类型参数:
I- the input type for the interception point- 参数:
middlewares- ordered list of middlewares (first = outermost)agent- the agent instance passed to each middlewarectx- per-call runtime context passed to each middlewaremethod- reference to the middleware hook methodcore- the innermost logic to execute when all middlewares delegate- 返回:
- a function that, when applied to an input, runs the full chain
-