View Source ExMaps.DirectionsCoordinator (ExMaps v1.1.3)
GenServer implementation for coordinating worker tasks.
This module manages the spawning of worker tasks to handle multiple requests concurrently, ensuring efficient processing of directions requests.
Summary
Functions
Returns a specification to start this module under a supervisor.
Spawns worker tasks to handle the given coordinates and options.
Starts the GenServer with optional configuration.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Spawns worker tasks to handle the given coordinates and options.
Parameters
coordinates
: A list of coordinate maps.options
: A keyword list of options for the worker tasks.
Examples
iex> ExMaps.DirectionsCoordinator.spawn_workers([%{origin: "A", destination: "B"}], key: :value)
[%{...}, ...]
Returns
- A list of results from the worker tasks.
Starts the GenServer with optional configuration.
Parameters
options
: A keyword list of options for the GenServer.
Examples
iex> ExMaps.DirectionsCoordinator.start_link()
{:ok, pid}
Returns
{:ok, pid}
on successful start{:error, reason}
if there is an error