pub trait Source {
// Required method
fn run<'async_trait>(
self: Box<Self>,
context: SourceContext,
) -> Pin<Box<dyn Future<Output = Result<(), GenericError>> + Send + 'async_trait>>
where Self: 'async_trait;
}
Expand description
A source.
Sources are the initial entrypoint to a topology, where events are ingested from external systems, or sometimes generated. Examples of typical sources include StatsD, log files, and message queues.
Required Methods§
Sourcefn run<'async_trait>(
self: Box<Self>,
context: SourceContext,
) -> Pin<Box<dyn Future<Output = Result<(), GenericError>> + Send + 'async_trait>>where
Self: 'async_trait,
fn run<'async_trait>(
self: Box<Self>,
context: SourceContext,
) -> Pin<Box<dyn Future<Output = Result<(), GenericError>> + Send + 'async_trait>>where
Self: 'async_trait,
Runs the source.
The source context provides access primarily to the forwarder, used to send events to the next component(s) in the topology, as well as other information such as the component context.
Sources are expected to run indefinitely until their shutdown is triggered by the topology, or an error occurs.
§Errors
If an unrecoverable error occurs while running, an error is returned.