apply method
Asynchronously applies a function to the wrapped cell.
This method acquires a lock on the cell's properties to ensure thread safety, then delegates to the cell's synchronous Cell.apply method.
Parameters:
function: The function to execute.positionalArguments: Arguments passed by position.namedArguments: Arguments passed by name.
Returns: A Future that completes with the result of the function application.
Implementation
Future apply(
Function function, {
List? positionalArguments,
Map<Symbol, dynamic>? namedArguments,
ApplyTransactionScope? tx,
Function? compensate,
List? compensatePositional,
Map<Symbol, dynamic>? compensateNamed,
Cell? compensateCell,
}) async {
final lock = _cell._nucleus.lock;
return lock != null
? lock.synchronized(() => _cell.apply(function,
positionalArguments: positionalArguments,
namedArguments: namedArguments))
: Future(() => _cell.apply(function,
positionalArguments: positionalArguments,
namedArguments: namedArguments));
}