Skip to content

Caching data between invocations #372

Closed
@rimutaka

Description

@rimutaka

It is possible to initialize a resource in main and pass it onto a closure inside handler_fn as a shared reference. Example: https://github.com/awslabs/aws-lambda-rust-runtime/blob/master/lambda-runtime/examples/shared_resource.rs

The downside of this method is that the initialization must be done upfront and the resource cannot be updated.

I've been trying to implement a cache that can be updated from inside the handler, but no matter what I tried it's a breaking change.

Does anyone know a way of updating a shared resource from inside the handler fn without breaking the current handler_fn interface?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions