LocationSimulator.DynamicSupervisor (LocationSimulator v1.1.0)

Copy Markdown View Source

DynamicSupervisor, uses for add worker in runtime.

Module uses PartitionSupervisor to improve performance when start workers.

Summary

Functions

Returns a specification to start this module under a supervisor.

Starts all worker specs.

Functions

child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(init_arg)

@spec start_link(term()) :: :ignore | {:error, any()} | {:ok, pid()}

start_simulator(workers)

@spec start_simulator([tuple()]) :: :ok | {:error, term()}

Starts all worker specs.

Returns {:error, reason} of the first failing child; already-started workers are left running.