swift-server / swift-aws-lambda-runtime

Swift implementation of AWS Lambda Runtime
https://swiftpackageindex.com/swift-server/swift-aws-lambda-runtime
Apache License 2.0
1.15k stars 105 forks source link

Add an example and README for background tasks #418

Closed sebsto closed 2 weeks ago

sebsto commented 1 month ago

Add code example for Lambda Background Tasls

Motivation:

Partially addresses https://github.com/swift-server/swift-aws-lambda-runtime/issues/376

Modifications:

Add a directory Examples/BackgroundTasks with code sample and a README

I also slightly modified Lambda+Codable.swift to provide default JSONEncoder() and JSONDecoder() to not require user to create their own if they don't need to.

Result:

Developers know how to use Lambda background tasks

sebsto commented 1 month ago

This code requires to merge https://github.com/swift-server/swift-aws-lambda-runtime/pull/417 to work It will compile but no logger debug statement are printed without #417