Skip to content
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/tutorials/sinks/2_http_sink.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,12 @@ where the data is actually sent.

# Service

**⚠ NOTE! This section implements an HTTP tower `Service` from scratch, for the
purpose of demonstration only. Many sinks will require implementing `Service`
in this way. Any new HTTP based sink should ideally utilize the structure
`HttpService`, which handles most of what this section discusses in a shared
structure that HTTP based sinks can utilize.**
Comment thread
neuronull marked this conversation as resolved.
Outdated

We need to create a [`Tower`][tower] service that is responsible for actually
sending our final encoded data.

Expand Down
3 changes: 3 additions & 0 deletions src/sinks/appsignal/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ use super::request_builder::AppsignalRequest;

#[derive(Clone)]
pub(super) struct AppsignalService {
// TODO: `HttpBatchService` has been deprecated for direct use in sinks.
// This sink should undergo a refactor to utilize the `HttpService`
// instead, which extracts much of the boilerplate code for `Service`.
pub(super) batch_service:
HttpBatchService<Ready<Result<http::Request<Bytes>, crate::Error>>, AppsignalRequest>,
}
Expand Down
3 changes: 3 additions & 0 deletions src/sinks/datadog/events/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ impl DriverResponse for DatadogEventsResponse {

#[derive(Clone)]
pub struct DatadogEventsService {
// TODO: `HttpBatchService` has been deprecated for direct use in sinks.
// This sink should undergo a refactor to utilize the `HttpService`
// instead, which extracts much of the boilerplate code for `Service`.
batch_http_service:
HttpBatchService<Ready<Result<http::Request<Bytes>, crate::Error>>, DatadogEventsRequest>,
}
Expand Down
3 changes: 3 additions & 0 deletions src/sinks/elasticsearch/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ impl MetaDescriptive for ElasticsearchRequest {

#[derive(Clone)]
pub struct ElasticsearchService {
// TODO: `HttpBatchService` has been deprecated for direct use in sinks.
// This sink should undergo a refactor to utilize the `HttpService`
// instead, which extracts much of the boilerplate code for `Service`.
batch_service: HttpBatchService<
BoxFuture<'static, Result<http::Request<Bytes>, crate::Error>>,
ElasticsearchRequest,
Expand Down
Loading