Move topology inputs away from futures::Sink
#11261
Labels
domain: core
Anything related to core crates i.e. vector-core, core-common, etc
domain: topology
Anything related to Vector's topology code
type: tech debt
A code change that does not add user value.
Currently the
Fanout
type that is core to Vector's data plane handles generic targets that adhere to thefutures::Sink
trait. This is a trait we've been slowly trying to remove from the codebase for some time due to its complexity, potential for implementation bugs, and less-than-ideal performance.For those reasons, we'd like to replace the
GenericEventSink
type alias inFanout
with a simpler, concrete type that exposes an API better suited to our needs there. The main methods that'd be helpful would be:fn try_send(Event) -> Result<(), Event>
: try to send an event immediately, returning it if the downstream is not ready to accept itasync fn send(Event) -> Result<(), ClosedError>
: send an event downstream, yielding the current task if it is not yet ready and only returning an error when the downstream has permanently closedThis would have a few advantages for
Fanout
specifically:try_send
method would make it simple to first send to any ready inputs (the goal of the work around chore: Remove the Sink impl from Fanout #11206 and friends) and only wait to send to sinks that actually aren't ready yetpoll_*
methodsThe text was updated successfully, but these errors were encountered: