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

Remove futures_core::stream::Stream from public API #2910

Closed
wants to merge 41 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
6b308e4
Remove `futures_core::stream::Stream` from `smithy-async`
ysaito1001 Aug 8, 2023
9a27075
Remove `futures_core::stream::Stream` from `smithy-http`
ysaito1001 Aug 8, 2023
f5b440c
Remove `futures_core::stream::Stream` from `Paginator`
ysaito1001 Aug 9, 2023
2bcf9b5
Remove `futures_core::stream::Stream` from integration tests
ysaito1001 Aug 9, 2023
6e31754
Merge branch 'main' into ysaito/remove-futures-stream-from-public-api
ysaito1001 Aug 9, 2023
181440d
Fix links in docs
ysaito1001 Aug 9, 2023
f00d605
Fix codegen-server-test:test
ysaito1001 Aug 9, 2023
3e05c47
Fix tests in CI
ysaito1001 Aug 11, 2023
8e90987
Update pokemon example to use `FnStream`
ysaito1001 Aug 11, 2023
492e8bf
Fix more server tests
ysaito1001 Aug 11, 2023
2c7541b
Fix test name that checks both `Send` and `Sync`
ysaito1001 Aug 11, 2023
f7e8a69
Fix event-streaming tests in pokemon-service
ysaito1001 Aug 11, 2023
f3dae46
Let ser_* return concreate types instead of `impl Stream`
ysaito1001 Aug 11, 2023
3aae470
Port `event_stream_input_ergonomics` test
ysaito1001 Aug 11, 2023
3944bb3
Remove unused dependency from `aws-smithy-async`
ysaito1001 Aug 11, 2023
fd70e49
Update `pokemon-service-test` to use `FnStream`
ysaito1001 Aug 11, 2023
ae047e5
Remove unused `tokio_stream::StreamExt` from `canary-lambda`
ysaito1001 Aug 11, 2023
50fe74c
Tell udeps `futures_util` is used
ysaito1001 Aug 11, 2023
ccf9d06
Update latest for `canary-lambda`
ysaito1001 Aug 15, 2023
d31669b
Append `release-2023-08-03` to `NOTABLE_SDK_RELEASE_TAGS`
ysaito1001 Aug 16, 2023
f8c0c40
Add dependency on `aws-smithy-async`
ysaito1001 Aug 25, 2023
66420d5
Merge branch 'main' into ysaito/remove-futures-stream-from-public-api
ysaito1001 Aug 25, 2023
d853cb1
Remove 2023_01_26 that is more than 3 releases ago
ysaito1001 Aug 25, 2023
5f65dff
Update CHANGELOG.next.toml
ysaito1001 Aug 25, 2023
6abb519
Remove code duplication in calling `renderEventStreamBody`
ysaito1001 Aug 28, 2023
0491221
Remove uncecessary `CollectablePrivate`
ysaito1001 Aug 29, 2023
bedfb04
Use customization to wrap stream payload in new-type
ysaito1001 Aug 30, 2023
5698ee3
Let `finalize` take an owned associated collection
ysaito1001 Aug 30, 2023
d9052d5
Reexport `FnStream` and remove dependency on `aws-smithy-async`
ysaito1001 Aug 30, 2023
b281aee
Remove dependency on `aws-smithy-async` and use reexported `FnStream`
ysaito1001 Aug 30, 2023
d0452a0
Merge branch 'main' into ysaito/remove-futures-stream-from-public-api
ysaito1001 Aug 30, 2023
0f5f6be
Return size hint as is by `http_body::Body::size_hint`
ysaito1001 Aug 30, 2023
d2e4411
Add an comment `FnStream` is `Send` not `Sync`
ysaito1001 Aug 30, 2023
a778886
Add more comments as to why `generator` can be set to `None`
ysaito1001 Aug 30, 2023
292a51b
Merge branch 'main' into ysaito/remove-futures-stream-from-public-api
ysaito1001 Aug 30, 2023
ab57dce
Convert `StreamPayloadSerializer` to interface
ysaito1001 Aug 31, 2023
3db0525
Add comments to data class for `ServerHttpBoundProtocolSection`
ysaito1001 Aug 31, 2023
91163de
Use `ServiceShape.hasEventStreamOperations`
ysaito1001 Aug 31, 2023
f5c8a96
Move `hyper_body_wrap_stream` from inlineable to `aws-smithy-http`
ysaito1001 Sep 7, 2023
35a1fca
Merge branch 'main' into ysaito/remove-futures-stream-from-public-api
ysaito1001 Sep 8, 2023
852211f
Fix undeclared crate or module for feature-gated types
ysaito1001 Sep 8, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ private fun hasStreamingOperations(model: Model): Boolean {
}
}

/** Returns true if the model has event streaming operations */
private fun hasEventStreamOperations(model: Model): Boolean =
ysaito1001 marked this conversation as resolved.
Show resolved Hide resolved
model.operationShapes.any { operation ->
val input = model.expectShape(operation.inputShape, StructureShape::class.java)
val output = model.expectShape(operation.outputShape, StructureShape::class.java)
input.hasEventStreamMember(model) || output.hasEventStreamMember(model)
}

// TODO(https://github.com/awslabs/smithy-rs/issues/2111): Fix this logic to consider collection/map shapes
private fun structUnionMembersMatchPredicate(model: Model, predicate: (Shape) -> Boolean): Boolean =
model.structureShapes.any { structure ->
Expand Down Expand Up @@ -70,4 +78,12 @@ fun pubUseSmithyPrimitives(codegenContext: CodegenContext, model: Model): Writab
"SdkBody" to RuntimeType.smithyHttp(rc).resolve("body::SdkBody"),
)
}
if (hasEventStreamOperations(model)) {
rustTemplate(
"""
pub use #{FnStream};
""",
"FnStream" to RuntimeType.smithyAsync(rc).resolve("future::fn_stream::FnStream"),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use crate::canary::CanaryError;
use crate::mk_canary;
use aws_config::SdkConfig;
use aws_sdk_transcribestreaming as transcribe;
use aws_smithy_async::future::fn_stream::FnStream;
use bytes::BufMut;
use transcribe::primitives::Blob;
use transcribe::types::{
Expand All @@ -31,7 +30,7 @@ pub async fn transcribe_canary(
client: transcribe::Client,
expected_transcribe_result: String,
) -> anyhow::Result<()> {
let input_stream = FnStream::new(|tx| {
let input_stream = transcribe::primitives::FnStream::new(|tx| {
Box::pin(async move {
let pcm = pcm_data();
for chunk in pcm.chunks(CHUNK_SIZE) {
Expand Down
6 changes: 0 additions & 6 deletions tools/ci-cdk/canary-runner/src/build_bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ tracing-texray = "0.1.1"
reqwest = { version = "0.11.14", features = ["rustls-tls"], default-features = false }
"#;

const REQUIRED_SMITHY_CRATES: &[&str] = &["aws-smithy-async"];

const REQUIRED_SDK_CRATES: &[&str] = &[
"aws-config",
"aws-sdk-s3",
Expand Down Expand Up @@ -131,7 +129,6 @@ fn enabled_feature(crate_source: &CrateSource) -> String {

fn generate_crate_manifest(crate_source: CrateSource) -> Result<String> {
let mut output = BASE_MANIFEST.to_string();
write_dependencies(REQUIRED_SMITHY_CRATES, &mut output, &crate_source)?;
write_dependencies(REQUIRED_SDK_CRATES, &mut output, &crate_source)?;
write!(output, "\n[features]\n").unwrap();
writeln!(output, "latest = []").unwrap();
Expand Down Expand Up @@ -438,7 +435,6 @@ uuid = { version = "0.8", features = ["v4"] }
tokio-stream = "0"
tracing-texray = "0.1.1"
reqwest = { version = "0.11.14", features = ["rustls-tls"], default-features = false }
aws-smithy-async = { path = "some/sdk/path/aws-smithy-async" }
aws-config = { path = "some/sdk/path/aws-config" }
aws-sdk-s3 = { path = "some/sdk/path/s3" }
aws-sdk-ec2 = { path = "some/sdk/path/ec2" }
Expand Down Expand Up @@ -503,7 +499,6 @@ uuid = { version = "0.8", features = ["v4"] }
tokio-stream = "0"
tracing-texray = "0.1.1"
reqwest = { version = "0.11.14", features = ["rustls-tls"], default-features = false }
aws-smithy-async = "0.46.0"
aws-config = "0.46.0"
aws-sdk-s3 = "0.20.0"
aws-sdk-ec2 = "0.19.0"
Expand All @@ -520,7 +515,6 @@ default = ["latest"]
aws_doc_sdk_examples_revision: "some-revision-docs".into(),
manual_interventions: Default::default(),
crates: [
crate_version("aws-smithy-async", "0.46.0"),
crate_version("aws-config", "0.46.0"),
crate_version("aws-sdk-s3", "0.20.0"),
crate_version("aws-sdk-ec2", "0.19.0"),
Expand Down