Future defaultWorkerFunction(Worker worker)

Source

static defaultWorkerFunction(Worker worker) async {
  Map<String, WorkerMethod> methods;

  if (worker.get("methods") is Map<String, WorkerMethod>) {
    methods = worker.get("methods") as Map<String, WorkerMethod>;
  }

  return await worker.init(methods: methods);
}