Skip to content

Conversation

@DGPardo
Copy link
Contributor

@DGPardo DGPardo commented Jul 8, 2025

No description provided.

debug!("writer loop is shutting down");
}

#[cfg(test)]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know in this codebase we put the tests on a separate file but due to the module visibility restrictions I put it here just for showing the use case. Can move the test to a separate file and or get rid of it depending on the outcome of the discussion

Copy link
Member

Choose a reason for hiding this comment

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

We very much put unit tests in the same file. I only broke out the message store tests because spinning up a mongodb container in unit tests felt wrong.

@codecov
Copy link

codecov bot commented Jul 8, 2025

Codecov Report

Attention: Patch coverage is 41.66667% with 21 lines in your changes missing coverage. Please review.

Project coverage is 54.83%. Comparing base (034f079) to head (a3c383f).

Files with missing lines Patch % Lines
crates/hotfix/src/transport/connection.rs 0.00% 13 Missing ⚠️
crates/hotfix/src/transport/socket_writer.rs 73.33% 4 Missing ⚠️
crates/hotfix/src/transport/actor.rs 66.66% 2 Missing ⚠️
crates/hotfix/src/initiator.rs 0.00% 1 Missing ⚠️
crates/hotfix/src/transport/socket_reader.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #119      +/-   ##
==========================================
+ Coverage   54.05%   54.83%   +0.78%     
==========================================
  Files          59       60       +1     
  Lines        2653     2659       +6     
==========================================
+ Hits         1434     1458      +24     
+ Misses       1219     1201      -18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DGPardo DGPardo force-pushed the decoupling-tcp-connection-from-io branch from 9f856d8 to a3c383f Compare July 22, 2025 08:20
Copy link
Member

@davidsteiner davidsteiner left a comment

Choose a reason for hiding this comment

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

I think we should take a step back and start breaking out the modules that are related to a real FIX connection over TCP, and the generic bits that don't care about the actual connection.

break;
}
#[async_trait]
impl WriterModel for WriterRef {
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need to implement a trait for WriterRef? Other than the new function, it doesn't know about the writer, and I'm not even sure we'll need a writer in the mock implementation.

use crate::message::parser::RawFixMessage;

#[async_trait]
pub trait Actor<M: Send> {
Copy link
Member

Choose a reason for hiding this comment

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

This is possibly a good abstraction, but I don't see us taking advantage of it anywhere in this PR currently.

Copy link
Member

Choose a reason for hiding this comment

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

Also, I wouldn't conflate this PR with the creation of a more generic actor framework. It requires a bit more consideration as not all actors fit this exact implementation in fn run.


pub struct FixConnection {
_writer: WriterRef,
pub struct FixConnection<W: WriterModel> {
Copy link
Member

Choose a reason for hiding this comment

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

So this isn't on the right track - there is no need for the FixConnection to be generic. This relates to how I don't think the WriterRef needs to be further abstracted either.

}

/// Spawn a TCP or TLS FIX Connection
pub async fn build_connection(
Copy link
Member

Choose a reason for hiding this comment

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

This being moved out of FixConnection is a good step.

@DGPardo DGPardo closed this Jul 22, 2025
@DGPardo DGPardo deleted the decoupling-tcp-connection-from-io branch July 22, 2025 09:27
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.

3 participants