Sentinel icon indicating copy to clipboard operation
Sentinel copied to clipboard

Slot chain SPI should target slot itself rather than the entire builder

Open jialianglinjl opened this issue 7 years ago • 1 comments

Issue Description

Type: feature request

Describe what happened (or what feature you want)

Due to the fact that the order between slots in slot chain is essential, currently Sentinel make SlotChainBuilder as the slot chain SPI so that users can implement their own builder, where they can arrange the order between slots. But this introduce complexity for users to arrange the builder when there are many external slots from other dependency.

Describe what you expected to happen

The ideal approach is to make the slot itself as the SPI interface so that users only need to care about their own slot, rather than the global chain. But due to the fact that the order between slots in slot chain is essential, we have to provide a @Order annotation for users so that they can arrange the order with the annotation. And the default slots of Sentinel (e.g. StatisticSlot) should have their own unique order respectively.

jialianglinjl avatar Dec 19 '18 06:12 jialianglinjl

Maybe I can have a try. its more like filter chain.

as I see.
user can define custom Slot, and order in the slot chain, then register to the SlotChain, and SlotChain.getNext() indexed with order.

NodeSelectorSlot, StatisticSlot, ClusterBuilderSlot are the basic type, and others are custom type.

we provide SlotRegister that only custom type slot allowed.

tigerMoon avatar Jan 11 '19 10:01 tigerMoon