operations property

  1. @override
Map<int, CommandHandler> operations
latefinal

Map of command handlers. Upon reception of a WorkerRequest, the platform worker will dispatch the request to the CommandHandler mathing the value of WorkerRequest.command.

Implementation

@override
late final Map<int, CommandHandler> operations =
{
  ImageService.methodGray: (WorkerRequest r)
  {
    return gray(r.args[0]);
  },
  ImageService.methodCrop: (WorkerRequest r)
  {
    return crop(r.args[0],r.args[1],r.args[2],r.args[3],r.args[4]);
  },
  ImageService.methodFlip: (WorkerRequest r)
  {
    return flip(r.args[0],r.args[1]);
  },
  ImageService.methodResize: (WorkerRequest r)
  {
    return resize(r.args[0],r.args[1],r.args[2]);
  },
};