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

Create high-level AWS event streams #322

Merged
merged 1 commit into from
Oct 24, 2024
Merged

Conversation

JordonPhillips
Copy link
Contributor

This updates the high-level event stream interfaces and creates AWS implementations of them.

The EventStream protocol was split into three protocols: DuplexEventStream, InputEventStream, and OutputEventStream. These three classes encompass the three different configurations that clients can expect, and each are typed with their particular use-case in mind. This lets the type declarations be more concise and accurate. Before, it could be extremely ambiguous from a typing perspective what you were getting.

The old InputEventStream and OutputEventStream classes were renamed to AsyncEventPublisher and AsyncEventReceiver, respectively. This is a more accurate description of what they do, particularly as they can be used for a service implementation as well.

In the AWS implementation, some changes needed to be made. Notably the Event class had to get a decode_async method to be able to read from an async stream. Then the calling of that method had to be pulled out of the deserializer so that both sync and async clients can use it. Test cases were updated to also test the async method.

Tests for the event stream classes will come in the form of protocol tests later on.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

This updates the high-level event stream interfaces and creates AWS
implementations of them.

The `EventStream` protocol was split into three protocols:
`DuplexEventStream`, `InputEventStream`, and `OutputEventStream`.
These three classes encompass the three different configurations that
clients can expect, and each are typed with their particular use-case
in mind. This lets the type declarations be more concise and
accurate. Before, it could be extremely ambiguous from a typing
perspective what you were getting.

The old `InputEventStream` and `OutputEventStream` classes were
renamed to `AsyncEventPublisher` and `AsyncEventReceiver`,
respectively. This is a more accurate description of what they do,
particularly as they can be used for a service implementation as
well.

In the AWS implementation, some changes needed to be made. Notably
the `Event` class had to get a `decode_async` method to be able to
read from an async stream. Then the calling of that method had to
be pulled out of the deserializer so that both sync and async
clients can use it. Test cases were updated to also test the async
method.

Tests for the event stream classes will come in the form of protocol
tests later on.
Copy link
Contributor

@nateprewitt nateprewitt left a comment

Choose a reason for hiding this comment

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

Looks good, approving since the test failures are related to the latest Smithy release and we had a clean run yesterday with no functional changes.

@JordonPhillips JordonPhillips merged commit 7cec4ee into develop Oct 24, 2024
3 of 5 checks passed
@JordonPhillips JordonPhillips deleted the high-level-aws-streams branch October 24, 2024 15:08
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