Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make sourcetransfomer API simpler #34

Merged
merged 7 commits into from
Mar 25, 2024
Merged

feat: make sourcetransfomer API simpler #34

merged 7 commits into from
Mar 25, 2024

Conversation

vigith
Copy link
Member

@vigith vigith commented Mar 22, 2024

No description provided.

Signed-off-by: Vigith Maurice <vigith@gmail.com>
Signed-off-by: Vigith Maurice <vigith@gmail.com>
Signed-off-by: Vigith Maurice <vigith@gmail.com>
Signed-off-by: Vigith Maurice <vigith@gmail.com>
Signed-off-by: Vigith Maurice <vigith@gmail.com>
@vigith vigith marked this pull request as ready for review March 22, 2024 17:39
@vigith vigith requested review from BulkBeing and yhl25 March 22, 2024 17:39
@vigith vigith changed the title feat: make sourcetransfomer interface simple feat: make sourcetransfomer API simpler Mar 22, 2024
@@ -10,5 +10,5 @@ path = "src/main.rs"
[dependencies]
tonic = "0.9"
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] }
numaflow = { git = "https://github.com/numaproj/numaflow-rs.git", branch = "main" }
numaflow = { path = "../../" }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to do this for all examples

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can copy the Dockerfile changes (rust compiler image, source for final image) and .dockerignore files from map-cat example to the source-transformer-now example also.

#[async_trait]
pub trait SourceTransformer {
/// transform takes in an input element and can produce 0, 1, or more results. The input is a [`Datum`]
/// transform takes in an input element and can produce 0, 1, or more results. The input is a [`SourceTransformRequest`]
/// and the output is a ['Vec`] of [`Message`]. In a `transform` each element is processed independently
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mismatched backtick here: ['Vec`]

Ok(Response::new(proto::SourceTransformResponse {
results: messages
.into_iter()
.map(move |msg| msg.into())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move keyword is not needed here

sock_addr: PathBuf,
max_message_size: usize,
server_info_file: PathBuf,
sourcetrf_svc: Option<T>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think field name can be generic like svc since we don't specify trait bounds for T on the struct.

@@ -10,5 +10,5 @@ path = "src/main.rs"
[dependencies]
tonic = "0.9"
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] }
numaflow = { git = "https://github.com/numaproj/numaflow-rs.git", branch = "main" }
numaflow = { path = "../../" }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can copy the Dockerfile changes (rust compiler image, source for final image) and .dockerignore files from map-cat example to the source-transformer-now example also.

Signed-off-by: Vigith Maurice <vigith@gmail.com>
Signed-off-by: Vigith Maurice <vigith@gmail.com>
@vigith vigith merged commit 9d81686 into main Mar 25, 2024
2 checks passed
@vigith vigith deleted the source-transformer branch March 25, 2024 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants