Current section

Files

Jump to
crawler lib crawler.ex
Raw

lib/crawler.ex

defmodule Crawler do
use Application
def start(_type, _args) do
Crawler.Supervisor.start_link()
end
def crawl(url, opts \\ []) do
opts = opts ++ [url: url]
{:ok, worker} = Crawler.Supervisor.start_child(opts)
Crawler.Worker.cast(worker, opts)
end
end