LocationSimulator.Pipeline (LocationSimulator v1.0.0)

Copy Markdown View Source

Declares a composable GPS simulation pipeline using Spark DSL.

Usage

defmodule MyApp.TaxiFleet do
  use LocationSimulator.Pipeline

  source :synthetic, direction: :north, elevation: 50

  plug LocationSimulator.Plug.Callback, callback: MyApp.TaxiHandler
end

Then start workers at runtime:

LocationSimulator.start(MyApp.TaxiFleet, worker: 3, event: 100, interval: 1_000)

Default pipeline

If you want the legacy behaviour (no explicit pipeline module), pass a plain config map instead:

LocationSimulator.start(%{worker: 3, callback: MyApp.Handler})

Options

  • :extensions (list of module that adopts Spark.Dsl.Extension) - A list of DSL extensions to add to the Spark.Dsl

  • :otp_app (atom/0) - The otp_app to use for any application configurable options

  • :fragments (list of module/0) - Fragments to include in the Spark.Dsl. See the fragments guide for more.