-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: follow design patterns for publishers
- Loading branch information
Showing
15 changed files
with
133 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
src/AWS.Messaging/Publishers/EventBridge/IEventBridgePublisher.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
using AWS.Messaging.Services; | ||
|
||
namespace AWS.Messaging.Publishers.SQS | ||
{ | ||
/// <summary> | ||
/// This interface allows publishing messages from application code to Amazon SQS. | ||
/// It exposes the <see cref="PublishAsync{T}(T, SQSOptions?, CancellationToken)"/> method which takes in a user-defined message, and <see cref="SQSOptions"/> to set additonal parameters while publishing messages to SQS. | ||
/// This interface allows sending messages from application code to Amazon SQS. | ||
/// It exposes the <see cref="SendAsync{T}(T, SQSOptions?, CancellationToken)"/> method which takes in a user-defined message, and <see cref="SQSOptions"/> to set additional parameters while sending messages to SQS. | ||
/// Using dependency injection, this interface is available to inject anywhere in the code. | ||
/// </summary> | ||
public interface ISQSPublisher | ||
public interface ISQSPublisher : ICommandPublisher | ||
{ | ||
/// <summary> | ||
/// Publishes the application message to SQS. | ||
/// Sends the application message to SQS. | ||
/// </summary> | ||
/// <param name="message">The application message that will be serialized and sent to an SQS queue</param> | ||
/// <param name="sqsOptions">Contains additional parameters that can be set while sending a message to an SQS queue</param> | ||
/// <param name="token">The cancellation token used to cancel the request.</param> | ||
Task PublishAsync<T>(T message, SQSOptions? sqsOptions, CancellationToken token = default); | ||
Task SendAsync<T>(T message, SQSOptions? sqsOptions, CancellationToken token = default); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\r | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
namespace AWS.Messaging.Services; | ||
|
||
/// <summary> | ||
/// This interface allows sending messages from application code to recipient-specific Amazon services. | ||
/// It exposes the <see cref="SendAsync{T}(T, CancellationToken)"/> method which takes in a user-defined message to send to a recipient-specific Amazon service. | ||
/// </summary> | ||
public interface ICommandPublisher | ||
{ | ||
/// <summary> | ||
/// Sends the application message to a recipient-specific Amazon service. | ||
/// </summary> | ||
/// <param name="message">The application message that will be serialized and sent.</param> | ||
/// <param name="token">The cancellation token used to cancel the request.</param> | ||
Task SendAsync<T>(T message, CancellationToken token = default); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\r | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
namespace AWS.Messaging.Services; | ||
|
||
/// <summary> | ||
/// This interface allows publishing messages from application code to event-based Amazon services. | ||
/// It exposes the <see cref="PublishAsync{T}(T, CancellationToken)"/> method which takes in a user-defined message to publish to an event-based Amazon service. | ||
/// </summary> | ||
public interface IEventPublisher | ||
{ | ||
/// <summary> | ||
/// Publishes the application message to an event-based Amazon service. | ||
/// </summary> | ||
/// <param name="message">The application message that will be serialized and published.</param> | ||
/// <param name="token">The cancellation token used to cancel the request.</param> | ||
Task PublishAsync<T>(T message, CancellationToken token = default); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.