Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecsl committed Jan 17, 2025
1 parent 84a59ff commit a3516d5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions eppo_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ rust-version = "1.75.0"

[features]
# Unstable feature flag for an upcoming feature.
event_ingestion = ["dep:uuid", "dep:linked_hash_set"]
event_ingestion = ["dep:uuid"]
# Add implementation of `FromPyObject`/`ToPyObject` for some types.
pyo3 = ["dep:pyo3", "dep:serde-pyobject"]
# Add implementation of `TryConvert`/`IntoValue` for some types.
Expand All @@ -38,7 +38,6 @@ serde-bool = "0.1.3"
serde_json = "1.0.116"
serde_with = { version = "3.11.0", default-features = false, features = ["base64", "hex", "macros"] }
thiserror = "2.0.3"
linked_hash_set = { version = "0.1.5", optional = true }
tokio = { version = "1.34.0", default-features = false, features = ["macros", "sync", "rt", "time", "test-util"] }
url = "2.5.0"
uuid = { version = "1.11.0", features = ["v4", "serde"], optional = true }
Expand Down
8 changes: 4 additions & 4 deletions eppo_core/src/event_ingestion/event_delivery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ use url::Url;
use uuid::Uuid;

#[derive(Clone)]
pub struct EventDelivery {
pub(super) struct EventDelivery {
sdk_key: Str,
ingestion_url: Url,
client: reqwest::Client,
}

#[derive(serde::Deserialize)]
pub struct EventDeliveryResponse {
pub(super) struct EventDeliveryResponse {
pub failed_events: HashSet<Uuid>,
}

#[derive(thiserror::Error, Debug)]
pub enum EventDeliveryError {
pub(super) enum EventDeliveryError {
#[error("Transient error delivering events")]
RetriableError(reqwest::Error),
#[error("Non-retriable error")]
Expand All @@ -44,7 +44,7 @@ impl EventDelivery {
}

/// Delivers the provided event batch and returns a Vec with the events that failed to be delivered.
pub async fn deliver(
pub(super) async fn deliver(
self,
events: Vec<Event>,
) -> Result<EventDeliveryResponse, EventDeliveryError> {
Expand Down
4 changes: 2 additions & 2 deletions eppo_core/src/event_ingestion/event_dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const MIN_BATCH_SIZE: usize = 1;
const MAX_BATCH_SIZE: usize = 10_000;

#[derive(Debug, Clone)]
pub struct EventDispatcherConfig {
pub(super) struct EventDispatcherConfig {
pub sdk_key: String,
pub ingestion_url: String,
pub delivery_interval: Duration,
Expand All @@ -28,7 +28,7 @@ pub struct EventDispatcherConfig {

/// EventDispatcher is responsible for batching events and delivering them to the ingestion service
/// via [`EventDelivery`].
pub struct EventDispatcher {
pub(super) struct EventDispatcher {
config: EventDispatcherConfig,
}

Expand Down

0 comments on commit a3516d5

Please sign in to comment.