You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After SE-0346 lands in Swift 5.7, it’s possible for us to mark Event and Output as primary associate types for LambdaHandler. This can simplify a demo handler from:
@mainstructMyLambda:LambdaHandler{typealiasEvent=StringtypealiasOutput=Stringinit(context:LambdaInitializationContext)asyncthrows{// setup your resources that you want to reuse for every invocation here.}func handle(_ input:String, context:LambdaContext)asyncthrows->String{// as an example, respond with the input's reversedString(input.reversed())}}
into
@mainstructMyLambda:LambdaHandler<String,String>{init(context:LambdaInitializationContext)asyncthrows{// setup your resources that you want to reuse for every invocation here.}func handle(_ input:String, context:LambdaContext)asyncthrows->String{// as an example, respond with the input's reversedString(input.reversed())}}
The text was updated successfully, but these errors were encountered:
Note that the demo doesn’t work at the moment because parameterized protocol support is not fully implemented yet. It is valid and hopefully we could use it starting from 5.7.
After SE-0346 lands in Swift 5.7, it’s possible for us to mark
Event
andOutput
as primary associate types forLambdaHandler
. This can simplify a demo handler from:into
The text was updated successfully, but these errors were encountered: