Building a big stack of layers sometimes results in pretty long and unwieldily types, even with only a few layers, e.g. Stack<Either<TimeoutLayer, Identity>, Stack<Either<GlobalConcurrencyLimitLayer, Identity>, Stack<Either<LoadShedLayer, Identity>, Identity>>>
When working with such layers, BoxLayer can be useful, but only if you need a BoxService. If you want to produce a BoxCloneService, you are out of luck. Should tower add a BoxCloneLayer? Am I approaching this all wrong? I want to be able to combine several layers and pass them to a ServiceBuilder (e.g. Layers with a common configuration source) without having to write & edit a huge type every time.
Building a big stack of layers sometimes results in pretty long and unwieldily types, even with only a few layers, e.g.
Stack<Either<TimeoutLayer, Identity>, Stack<Either<GlobalConcurrencyLimitLayer, Identity>, Stack<Either<LoadShedLayer, Identity>, Identity>>>
When working with such layers,
BoxLayer
can be useful, but only if you need aBoxService
. If you want to produce aBoxCloneService
, you are out of luck. Should tower add aBoxCloneLayer
? Am I approaching this all wrong? I want to be able to combine several layers and pass them to aServiceBuilder
(e.g. Layers with a common configuration source) without having to write & edit a huge type every time.