retainOperation method
Retains the resource until the returned lease is released.
Adapters must release in finally after their operation's complete use of
the resource, including result conversion or asynchronous settlement.
Implementation
@override
OperationLease retainOperation() {
if (_completion != null) {
throw StateError('Resource is ${state.name}.');
}
_operations++;
return _ResourceLease(this);
}