Skip to content

Commit

Permalink
chore: code review
Browse files Browse the repository at this point in the history
Signed-off-by: Vigith Maurice <vigith@gmail.com>
  • Loading branch information
vigith committed Feb 18, 2024
1 parent d00aae2 commit a088e33
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/sink-log/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
sink::Server::new(Logger {}).start().await
}

struct Logger {}
struct Logger;

#[tonic::async_trait]
impl sink::Sinker for Logger {
Expand Down
2 changes: 1 addition & 1 deletion src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ pub struct Server<T> {
map_svc: Option<T>,
}

impl<T: Mapper> Server<T> {
impl<T> Server<T> {
pub fn new(map_svc: T) -> Self {
let server_info_file = if std::env::var_os("NUMAFLOW_POD").is_some() {
"/var/run/numaflow/server-info"
Expand Down
10 changes: 5 additions & 5 deletions src/sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ struct SinkService<T: Sinker> {
pub handler: T,
}

/// Sinker trait implements the user defined sink handle.
/// Sinker trait for implementing user defined sinks.
///
/// Types implementing this trait can be passed as user-defined sink handle.
#[tonic::async_trait]
pub trait Sinker {
/// The sink handle is given a stream of [`Datum`]. The result is [`Response`].
/// The sink handle is given a stream of [`SinkRequest`] and the result is [`Response`].
///
/// # Example
///
/// A simple log sink.
///
/// ```rust,ignore
/// ```no_run
/// use numaflow::sink::{self, Response, SinkRequest};
/// use std::error::Error;
///
Expand All @@ -40,7 +40,7 @@ pub trait Sinker {
/// sink::Server::new(Logger {}).start().await
/// }
///
/// struct Logger {}
/// struct Logger;
///
/// #[tonic::async_trait]
/// impl sink::Sinker for Logger {
Expand Down Expand Up @@ -105,7 +105,7 @@ impl From<RPCSinkRequest> for SinkRequest {
}
}

/// Response is the result returned from the [`Sinker::sink`].
/// The result of the call to [`Sinker::sink`] method.
pub struct Response {
/// id is the unique ID of the message.
pub id: String,
Expand Down

0 comments on commit a088e33

Please sign in to comment.