Fork me on GitHub
#aws
<
2022-05-07
>
lispers-anonymous13:05:50

Memoize can be not that great if you want to override the default http-client (see this section of the readme: https://github.com/cognitect-labs/aws-api#ops-limit-reached) and need to shut the client down when it's not in use. There is no good way to bust a cached value with memoize. We create our clients once and then pass them around where they are needed. No need to worry about stale clients that have been shutdown when we control it's lifecycle.

👍 1
lispers-anonymous13:05:26

That's a specific example of why global state sucks. I do not trust memoize for managing long lived objects. It has bitten my team pretty hard a couple times now.