Skip to content

Add a method that activates transaction mode #72

@swithek

Description

@swithek

It would be nice to have a method that would accept a function and execute it with a new global transaction mutex locked:

func (c *Cache[K, V]) Tx(fn func(*Tx[K, V])) {
         c.txMu.Lock()
         tx := c.beginTx()
         fn(tx)
         c.txMu.Unlock()
}

This was addressed in this issue; however, due to some limitations of the previous versions it was closed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions