executeOperation method
Future<bool>
executeOperation(
- OperationInput input, {
- required OperationDescriptor descriptor,
})
Implementation
Future<bool> executeOperation(
OperationInput input, {
required OperationDescriptor descriptor,
}) async {
if (descriptor.kind == OperationKind.assertion) {
return _assertionOperations.execute(
input,
handlerKey: descriptor.handlerKey,
);
}
final environmentHandler = _environmentHandlers[descriptor.handlerKey];
if (environmentHandler != null) {
await environmentHandler(input);
return true;
}
final lifecycleHandler = _lifecycleHandlers[descriptor.handlerKey];
if (lifecycleHandler != null) {
await lifecycleHandler(descriptor, input);
return true;
}
final handler = _operationInputHandlers[descriptor.handlerKey];
if (handler == null) return false;
await handler(input);
return true;
}