Open cglong opened 4 weeks ago
I like the idea, but to be clear, this is by definition a non-breaking change. E.g. in case someone was passing a type T
as .into()
it will no longer compile given the compiler wouldn't know to what concrete type you want to into
it.
Another thought, if it's cheap for you to create or clone that portion of your service, you could inspect the request, and then clone your inner service and wrap it in a new Timeout layer and the basically oneshot.
@GlenDC, I assume that's a typo and you mean it is a breaking change. If so, thank you, that's a good callout!
@seanmonstar, yeah that should be possible for our scenario! Thank you for the workaround 😄
Right now,
TimeoutLayer
accepts aDuration
parameter which specifies how long to wait before aborting a response. I'd like to customize this parameter on a per-request basis.I'm envisioning this should be doable with a trait with one method; that method takes in a request and returns the
Duration
. We should be able to implement this trait forDuration
itself so this won't be a breaking change.