Skip to content

Being able to set an expiration time per key, and not just per dict #7

@subnetmarco

Description

@subnetmarco

Currently it's only possible to set an expiration time to the entire dictionary when creating a new instance:

local obj = resty_lock:new("locks_dict", {exptime = 10})

It would be nice to allow setting an expiration time per key too, like:

local obj = resty_lock:new("reports_locks")
obj:lock("test", {exptime = 10})

So that one dictionary can be used to set multiple keys with a different expiration time:

local obj = resty_lock:new("reports_locks")
obj:lock("test", {exptime = 10})
obj:lock("test2", {exptime = 4})
obj:lock("test3", {exptime = 50})

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