Show / Hide Table of Contents

Class ALambdaFunction<TRequest, TResponse>

The ALambdaFunction<TRequest, TResponse> builds on the ALambdaFunction by adding request and response types which are automatically deserialized and serialized, respectively.

Inheritance
System.Object
ALambdaFunction
ALambdaFunction<TRequest, TResponse>
Implements
ILambdaSharpLogger
Inherited Members
ALambdaFunction.UtcNow
ALambdaFunction.Info
ALambdaFunction.ErrorReportGenerator
ALambdaFunction.Logger
ALambdaFunction.CurrentContext
ALambdaFunction.HttpClient
ALambdaFunction.DebugLoggingEnabled
ALambdaFunction.InitializeAsync(LambdaConfig)
ALambdaFunction.FunctionHandlerAsync(Stream, ILambdaContext)
ALambdaFunction.InitializePrologueAsync(ILambdaConfigSource)
ALambdaFunction.InitializeEpilogueAsync()
ALambdaFunction.HandleFailedInitializationAsync(Stream)
ALambdaFunction.RecordFailedMessageAsync(LambdaLogLevel, ALambdaFunction.FailedMessageOrigin, String, Exception)
ALambdaFunction.DecryptSecretAsync(String, Dictionary<String, String>, CancellationToken)
ALambdaFunction.EncryptSecretAsync(String, String, Dictionary<String, String>, CancellationToken)
ALambdaFunction.AddPendingTask(Task)
ALambdaFunction.RunTask(Action, CancellationToken)
ALambdaFunction.RunTask(Func<Task>, CancellationToken)
ALambdaFunction.ForceLambdaColdStart(String)
ALambdaFunction.TerminateLambdaInstance(String)
ALambdaFunction.RecordErrorReport(LambdaErrorReport)
ALambdaFunction.RecordException(Exception)
ALambdaFunction.LogDebug(String, Object[])
ALambdaFunction.LogInfo(String, Object[])
ALambdaFunction.LogWarn(String, Object[])
ALambdaFunction.LogError(Exception)
ALambdaFunction.LogError(Exception, String, Object[])
ALambdaFunction.LogErrorAsInfo(Exception)
ALambdaFunction.LogErrorAsInfo(Exception, String, Object[])
ALambdaFunction.LogErrorAsWarning(Exception)
ALambdaFunction.LogErrorAsWarning(Exception, String, Object[])
ALambdaFunction.LogFatal(Exception, String, Object[])
ALambdaFunction.LogMetric(String, Double, LambdaMetricUnit)
ALambdaFunction.LogMetric(String, Double, LambdaMetricUnit, IEnumerable<String>, Dictionary<String, String>)
ALambdaFunction.LogMetric(IEnumerable<LambdaMetric>)
ALambdaFunction.LogMetric(IEnumerable<LambdaMetric>, IEnumerable<String>, Dictionary<String, String>)
ALambdaFunction.LogEvent<T>(T, IEnumerable<String>)
ALambdaFunction.LogEvent<T>(String, T, IEnumerable<String>)
ALambdaFunction.LogEvent<T>(String, String, T, IEnumerable<String>)
ALambdaFunction.ILambdaSharpLogger.DebugLoggingEnabled
ALambdaFunction.ILambdaSharpLogger.Info
ALambdaFunction.ILambdaSharpLogger.Log(LambdaLogLevel, Exception, String, Object[])
ALambdaFunction.ILambdaSharpLogger.LogRecord(ALambdaLogRecord)
Namespace: LambdaSharp
Assembly: LambdaSharp.dll
Syntax
public abstract class ALambdaFunction<TRequest, TResponse> : ALambdaFunction, ILambdaSharpLogger
Type Parameters
Name Description
TRequest

The request payload type.

TResponse

The response payload type.

Constructors

ALambdaFunction(ILambdaJsonSerializer)

Initializes a new ALambdaFunction<TRequest, TResponse> instance using the default implementation of ILambdaFunctionDependencyProvider.

Declaration
protected ALambdaFunction(ILambdaJsonSerializer serializer)
Parameters
Type Name Description
ILambdaJsonSerializer serializer

Custom implementation of ILambdaJsonSerializer.

ALambdaFunction(ILambdaJsonSerializer, ILambdaFunctionDependencyProvider)

Initializes a new ALambdaFunction<TRequest, TResponse> instance using a custom implementation of ILambdaFunctionDependencyProvider.

Declaration
protected ALambdaFunction(ILambdaJsonSerializer serializer, ILambdaFunctionDependencyProvider provider)
Parameters
Type Name Description
ILambdaJsonSerializer serializer

Custom implementation of ILambdaJsonSerializer.

ILambdaFunctionDependencyProvider provider

Custom implementation of ILambdaFunctionDependencyProvider.

Properties

LambdaSerializer

An instance of ILambdaJsonSerializer used for serializing/deserializing JSON data.

Declaration
protected ILambdaJsonSerializer LambdaSerializer { get; }
Property Value
Type Description
ILambdaJsonSerializer

The ILambdaJsonSerializer instance.

Provider

The ILambdaFunctionDependencyProvider instance used by the Lambda function to satisfy its required dependencies.

Declaration
protected ILambdaFunctionDependencyProvider Provider { get; }
Property Value
Type Description
ILambdaFunctionDependencyProvider

The ILambdaFunctionDependencyProvider instance.

Methods

ProcessMessageAsync(TRequest)

The ProcessMessageAsync(TRequest) method is invoked for every deserialized request. It is responsible for processing the request and returning a response.

Declaration
public abstract Task<TResponse> ProcessMessageAsync(TRequest message)
Parameters
Type Name Description
TRequest message

The deserialized request.

Returns
Type Description
System.Threading.Tasks.Task<TResponse>

The task object representing the asynchronous operation.

ProcessMessageStreamAsync(Stream)

The ProcessMessageStreamAsync(Stream) deserializes the request stream into a TRequest instance and invokes the ProcessMessageAsync(TRequest) method.

Declaration
public override sealed Task<Stream> ProcessMessageStreamAsync(Stream stream)
Parameters
Type Name Description
System.IO.Stream stream

The stream with the request payload.

Returns
Type Description
System.Threading.Tasks.Task<System.IO.Stream>

The task object representing the asynchronous operation.

Overrides
ALambdaFunction.ProcessMessageStreamAsync(Stream)
Remarks

This method is sealed and cannot be overridden.

Implements

ILambdaSharpLogger
In This Article
Back to top Generated by DocFX