Unverified Commit bc2476d9 authored by Zelda Hessler's avatar Zelda Hessler Committed by GitHub
Browse files

update: require that unmarshaller used to create a Receiver is Send (#702)



* update: require that unmarshaller used to create a Receiver is Send

* update: changelogs

* Fix typo in CHANGELOG.md

Co-authored-by: default avatarJohn DiSanti <jdisanti@amazon.com>

* Fix typo in aws/SDK_CHANGELOG.md

Co-authored-by: default avatarJohn DiSanti <jdisanti@amazon.com>

* add: test ensuring Receiver is Send

* remove: extra colons
parent 58461ea3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
vNext (Month, Day, Year)
=======================

- Update `Receiver`s to be `Send` (aws-sdk-rust#224)

v0.23 (September 14th, 2021)
=======================

+5 −0
Original line number Diff line number Diff line
vNext (Month Day, Year)
=======================

- Update `Receiver`s to be `Send` (aws-sdk-rust#224)

v0.0.18-alpha (September 14th, 2021)
=======================
- :tada: Add support for `OpenSearch` service & bring in other model updates (#todo)
+9 −2
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ where
/// Receives Smithy-modeled messages out of an Event Stream.
#[derive(Debug)]
pub struct Receiver<T, E> {
    unmarshaller: Box<dyn UnmarshallMessage<Output = T, Error = E>>,
    unmarshaller: Box<dyn UnmarshallMessage<Output = T, Error = E> + Send>,
    decoder: MessageFrameDecoder,
    buffer: SegmentedBuf<Bytes>,
    body: SdkBody,
@@ -153,7 +153,7 @@ pub struct Receiver<T, E> {
impl<T, E> Receiver<T, E> {
    /// Creates a new `Receiver` with the given message unmarshaller and SDK body.
    pub fn new(
        unmarshaller: impl UnmarshallMessage<Output = T, Error = E> + 'static,
        unmarshaller: impl UnmarshallMessage<Output = T, Error = E> + Send + 'static,
        body: SdkBody,
    ) -> Self {
        Receiver {
@@ -413,6 +413,13 @@ mod tests {
        );
    }

    fn assert_send<T: Send>() {}

    #[tokio::test]
    async fn receiver_is_send() {
        assert_send::<Receiver<(), ()>>();
    }

    #[derive(Debug)]
    struct TestServiceError;
    impl std::fmt::Display for TestServiceError {