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
We currently don't have any chance to stop the httpClient in a coordinated way, if we stop the LocalTestServer, which closes the Lambda.
This is why I propose the following:
We expand the ByteBufferLambdaHandler protocol with a function syncShutdown() throws which will be invoked, if the Lambda is stopped. We supply a default empty implementation so that developers only need to deal with it if they run into a problem.
In the SNS to Slack example I posted I had to make the Lambda a class and shutdown the HTTPClient in the deinit. It would be cleaner if we could do it inside a syncShutdown.
That sounds like a great and necessary addition. Forcing people to do lifecycle management in deinit will lead to really bad problems further down the line.
Uh oh!
There was an error while loading. Please reload this page.
In a non-trivial Lambda we might use an AHC, which we initialize with a factory method like this:
We currently don't have any chance to stop the
httpClient
in a coordinated way, if we stop theLocalTestServer
, which closes the Lambda.This is why I propose the following:
We expand the
ByteBufferLambdaHandler
protocol with a functionsyncShutdown() throws
which will be invoked, if the Lambda is stopped. We supply a default empty implementation so that developers only need to deal with it if they run into a problem.@tomerd @weissi @ktoso @adam-fowler wdyt?
The text was updated successfully, but these errors were encountered: