diff --git a/lib/buffy/throttle_and_timed.ex b/lib/buffy/throttle_and_timed.ex index 005d333..5e87363 100644 --- a/lib/buffy/throttle_and_timed.ex +++ b/lib/buffy/throttle_and_timed.ex @@ -70,9 +70,14 @@ defmodule Buffy.ThrottleAndTimed do children = [ ... {true, - Task.child_spec(fn -> - for x <- 1..10, do: MyModuleUsingThrottleAndTimed.throttle(some: "value", x: x) - end)} + Supervisor.child_spec( + {Task, + fn -> + for x <- 1..10, do: MyModuleUsingThrottleAndTimed.throttle(some: "value", x: x) + end}, + id: MyModuleUsingThrottleAndTimedInit, + restart: :temporary + )} ] ... ```