pub trait Forwarder {
// Required method
fn run<'async_trait>(
self: Box<Self>,
context: ForwarderContext,
) -> Pin<Box<dyn Future<Output = Result<(), GenericError>> + Send + 'async_trait>>
where Self: 'async_trait;
}
Expand description
A forwarder.
Forwarders are the final step in a topology, where events are sent to an external system, or exposed for collection. Examples of typical forwarders include databases, HTTP services, log files, and object storage.
Required Methods§
Sourcefn run<'async_trait>(
self: Box<Self>,
context: ForwarderContext,
) -> Pin<Box<dyn Future<Output = Result<(), GenericError>> + Send + 'async_trait>>where
Self: 'async_trait,
fn run<'async_trait>(
self: Box<Self>,
context: ForwarderContext,
) -> Pin<Box<dyn Future<Output = Result<(), GenericError>> + Send + 'async_trait>>where
Self: 'async_trait,
Runs the forwarder.
The forwarder context provides access primarily to the payload stream, used to receive payloads sent to the forwarder, as well as other information such as the component context.
Forwarders are expected to run indefinitely until their payload stream is terminated, or an error occurs.
§Errors
If an unrecoverable error occurs while running, an error is returned.