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

ENH: Add POC async implementation, example using storescp #542

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
3251368
ENH: Add POC async implementation, example using storescp
naterichman Jul 14, 2024
3140822
MAIN: Modify read_pdu to take in Buf trait.
naterichman Jul 25, 2024
b8d8200
MAIN: Implement PDataReader and PDataWriter with async
naterichman Aug 5, 2024
1f79816
MAIN: Finish implementing framing for reading
naterichman Aug 6, 2024
b37bea4
MAIN: Add POC async version of storescp and storescu
naterichman Aug 7, 2024
63e0736
MAIN: Cleaning up
naterichman Aug 7, 2024
d53c0f2
MAIN: Add implementation for AsyncRead to PDataReader
naterichman Aug 7, 2024
876aac9
MAIN: Enumerate specific needed features
naterichman Aug 7, 2024
dfd0fad
MAIN: Resolve unused imports and format code
naterichman Aug 7, 2024
5334e2d
MAIN: Fix implementation of poll_read and poll_write
naterichman Aug 7, 2024
250578c
MAIN: Formatting and fixing compilation warnings
naterichman Aug 7, 2024
b863798
MAIN: Simplify implementation of poll_read
naterichman Aug 8, 2024
fdccf13
MAIN: Review comments and implement async versions of tests
naterichman Aug 9, 2024
b73bb0d
MAIN: Add github workflow for async feature flag
naterichman Aug 9, 2024
113b7f7
MAIN: Enumerate needed tokio features
naterichman Aug 9, 2024
0b62586
MAIN: Fix warnings and compilation errors
naterichman Aug 9, 2024
4830f2f
MAIN: Fix CI issues
naterichman Aug 11, 2024
b813690
Merge remote-tracking branch 'origin/master' into async
naterichman Aug 14, 2024
0399fb8
MAIN: Update some locks
naterichman Aug 27, 2024
8c5ac5b
MAIN: Relax requirements for bytes and tokio
naterichman Aug 27, 2024
5a4c274
MAIN: Fix !552 in async code as well :)
naterichman Aug 30, 2024
484225d
ENH: Move async to separate modules
naterichman Sep 5, 2024
9750459
MAIN: More work updating to separate modules
naterichman Sep 5, 2024
de9ab0b
MAIN: Fix tests and doctests [skip ci]
naterichman Sep 5, 2024
d7ea692
MAIN: Fix implementation of send_pdata
naterichman Sep 6, 2024
f833f00
ENH: Update storescu with new implementation
naterichman Sep 6, 2024
5a4dd25
Merge remote-tracking branch 'origin/master' into async
naterichman Sep 6, 2024
618bb93
MAIN: Fix warnings from beta toolchain
naterichman Sep 6, 2024
cc75478
MAIN: Format and use fully qualified names for TCPStream
naterichman Oct 4, 2024
687f03b
Merge remote-tracking branch 'origin/master' into async
naterichman Oct 4, 2024
e316a73
MAIN: Update store-scp with new ul code as well
naterichman Oct 4, 2024
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
3 changes: 2 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
- run: cargo test -p dicom-pixeldata --features gdcm
# test dicom-pixeldata without default features
- run: cargo test -p dicom-pixeldata --no-default-features
- run: cargo test -p dicom-ul --features async
# run Clippy with stable toolchain
- if: matrix.rust == 'stable'
run: cargo clippy
Expand Down Expand Up @@ -60,4 +61,4 @@ jobs:
toolchain: stable
cache: true
- run: cargo check


157 changes: 157 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions scpproxy/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use clap::{crate_version, value_parser, Arg, ArgAction, Command};
use dicom_ul::pdu::reader::read_pdu;
use dicom_ul::pdu::writer::write_pdu;
use dicom_ul::pdu::Pdu;
use dicom_ul::association::client::get_client_pdu;
use snafu::{Backtrace, OptionExt, Report, ResultExt, Snafu, Whatever};
use std::io::Write;
use std::net::{Shutdown, TcpListener, TcpStream};
Expand Down Expand Up @@ -63,11 +63,11 @@ pub enum ThreadMessage {
},
ReadErr {
from: ProviderType,
err: dicom_ul::pdu::reader::Error,
err: dicom_ul::association::client::Error,
},
WriteErr {
from: ProviderType,
err: dicom_ul::pdu::writer::Error,
err: dicom_ul::pdu::WriteError,
},
Shutdown {
initiator: ProviderType,
Expand Down Expand Up @@ -96,7 +96,7 @@ fn run(
let message_tx = message_tx.clone();
scu_reader_thread = thread::spawn(move || {
loop {
match read_pdu(&mut reader, max_pdu_length, strict) {
match get_client_pdu(&mut reader, max_pdu_length, strict) {
Ok(pdu) => {
message_tx
.send(ThreadMessage::SendPdu {
Expand All @@ -105,7 +105,7 @@ fn run(
})
.context(SendMessageSnafu)?;
}
Err(dicom_ul::pdu::reader::Error::NoPduAvailable { .. }) => {
Err(dicom_ul::association::client::Error::ReceiveResponse{ .. }) => {
message_tx
.send(ThreadMessage::Shutdown {
initiator: ProviderType::Scu,
Expand Down Expand Up @@ -133,7 +133,7 @@ fn run(
let mut reader = scp_stream.try_clone().context(CloneSocketSnafu)?;
scp_reader_thread = thread::spawn(move || {
loop {
match read_pdu(&mut reader, max_pdu_length, strict) {
match get_client_pdu(&mut reader, max_pdu_length, strict) {
Ok(pdu) => {
message_tx
.send(ThreadMessage::SendPdu {
Expand All @@ -142,7 +142,7 @@ fn run(
})
.context(SendMessageSnafu)?;
}
Err(dicom_ul::pdu::reader::Error::NoPduAvailable { .. }) => {
Err(dicom_ul::association::client::Error::ReceiveResponse{ .. }) => {
message_tx
.send(ThreadMessage::Shutdown {
initiator: ProviderType::Scp,
Expand Down
4 changes: 3 additions & 1 deletion storescp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ readme = "README.md"
[dependencies]
clap = { version = "4.0.18", features = ["derive"] }
dicom-core = { path = '../core', version = "0.7.0" }
dicom-ul = { path = '../ul', version = "0.7.1" }
dicom-ul = { path = '../ul', version = "0.7.1", features = ["async"] }
dicom-object = { path = '../object', version = "0.7.1" }
dicom-encoding = { path = "../encoding/", version = "0.7.1" }
dicom-dictionary-std = { path = "../dictionary-std/", version = "0.7.0" }
dicom-transfer-syntax-registry = { path = "../transfer-syntax-registry/", version = "0.7.1" }
snafu = "0.8"
tracing = "0.1.36"
tracing-subscriber = "0.3.15"
tokio = { version = "1.38.0", features = ["full"] }

Loading
Loading