Class ALambdaTopicFunction<TMessage>
The ALambdaTopicFunction<TMessage> is the abstract base class for handling Amazon Simple Notification Service (SNS) events.
Implements
Inherited Members
Namespace: LambdaSharp.SimpleNotificationService
Assembly: LambdaSharp.SimpleNotificationService.dll
Syntax
public abstract class ALambdaTopicFunction<TMessage> : ALambdaFunction, ILambdaSharpLogger
Type Parameters
Name | Description |
---|---|
TMessage | The SNS topic message type. |
Constructors
ALambdaTopicFunction(ILambdaJsonSerializer)
Initializes a new ALambdaTopicFunction<TMessage> instance using the default
implementation of ILambda
Declaration
protected ALambdaTopicFunction(ILambdaJsonSerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
ILambda |
serializer | Custom implementation of ILambda |
ALambdaTopicFunction(ILambdaJsonSerializer, ILambdaFunctionDependencyProvider)
Initializes a new ALambdaTopicFunction<TMessage> instance using a
custom implementation of ILambda
Declaration
protected ALambdaTopicFunction(ILambdaJsonSerializer serializer, ILambdaFunctionDependencyProvider provider)
Parameters
Type | Name | Description |
---|---|---|
ILambda |
serializer | Custom implementation of ILambda |
ILambda |
provider | Custom implementation of ILambda |
Properties
CurrentRecord
The Current
Declaration
protected SNSEvent.SNSMessage CurrentRecord { get; }
Property Value
Type | Description |
---|---|
Amazon. |
The Amazon. |
Remarks
This property is only set during the invocation of Processnull
.
LambdaSerializer
An instance of ILambda
Declaration
protected ILambdaJsonSerializer LambdaSerializer { get; }
Property Value
Type | Description |
---|---|
ILambda |
The ILambda |
Methods
Deserialize(String)
The Deserialize(String) method converts the SNS topic message from string to a typed instance.
Declaration
public virtual TMessage Deserialize(string body)
Parameters
Type | Name | Description |
---|---|---|
System. |
body | The SNS topic message. |
Returns
Type | Description |
---|---|
TMessage | The deserialized SNS topic message. |
Remarks
This method invokes Amazon.
ProcessMessageAsync(TMessage)
The Process
Declaration
public abstract Task ProcessMessageAsync(TMessage message)
Parameters
Type | Name | Description |
---|---|---|
TMessage | message | The deserialized SNS topic message. |
Returns
Type | Description |
---|---|
System. |
The task object representing the asynchronous operation. |
ProcessMessageStreamAsync(Stream)
The Process
Declaration
public sealed override async Task<Stream> ProcessMessageStreamAsync(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System. |
stream | The stream with the request payload. |
Returns
Type | Description |
---|---|
System. |
The task object representing the asynchronous operation. |
Overrides
Remarks
This method cannot be overridden.