start method

  1. @override
Future start(
  1. dynamic params
)
override

Instructs the agent to start processing

Implementation

@override
Future start(dynamic params) async {
  this.withPhase(WorkPhase.starting, () async {
    try {
      this.params = params;
      workPhase = WorkPhase.processing;
      sendStatus();

      await execute(params);
      progress = 100.0;
      workPhase = WorkPhase.stopped;
      sendStatus();
    } catch (e, stack) {
      log.severe("Error uploading file: $e", e, stack);
      error = ErrorStack(e, stack);
      workPhase = WorkPhase.stopping;
      sendStatus();

      await onError(this.error);
      workPhase = WorkPhase.error;
      sendStatus();
    }
  });
}