File tree 1 file changed +13
-0
lines changed
Sources/AWSLambdaRuntimeCore/Documentation.docc/Proposals
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -884,6 +884,19 @@ handler protocols:
884
884
(with a single call to ` writeAndFinish(_:) ` ). After closing the ` LambdaResponseStreamWriter ` , any background work can
885
885
be implemented.
886
886
887
+ ### Making LambdaResponseStreamWriter and LambdaResponseWriter ~ Copyable
888
+
889
+ We initially proposed to make the ` LambdaResponseStreamWriter ` and ` LambdaResponseWriter ` protocols ` ~Copyable ` , with
890
+ the functions that close the response having the ` consuming ` ownership keyword. This was so that the compiler could
891
+ enforce the restriction of not being able to interact with the writer after the response stream has closed.
892
+
893
+ However, non-copyable types do not compose nicely and add complexity for users. Further, for the compiler to actually
894
+ enforce the ` consuming ` restrictions, user's have to explicitly mark the writer argument as ` consuming ` in the ` handle `
895
+ function.
896
+
897
+ Therefore, throwing appropriate errors to prevent abnormal interaction with the writers seems to be the simplest
898
+ approach.
899
+
887
900
## A word about versioning
888
901
889
902
We are aware that AWS Lambda Runtime has not reached a proper 1.0. We intend to keep the current implementation around
You can’t perform that action at this time.
0 commit comments