read<T> static method

Future<T> read<T>(
  1. String rootPath,
  2. Future<T> action()
)

Runs action with a shared claim on the bundle at rootPath.

action must be safe to repeat: it runs again under a shared lock if the first writer creates the lock file during an initially unlocked read.

Implementation

static Future<T> read<T>(String rootPath, Future<T> Function() action) =>
    _synchronized(rootPath, action, exclusive: false);