Skip to content

Commit

Permalink
added typespecs for start_spider and stop_spider
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziinc committed Dec 11, 2019
1 parent 8de476a commit f3dd271
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/crawly/engine.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ defmodule Crawly.Engine do

defstruct started_spiders: %{}

@spec start_spider(module()) ::
{:ok, started_spiders()}
| {:error, :spider_already_started}
| {:error, :atom}
def start_spider(spider_name) do
GenServer.call(__MODULE__, {:start_spider, spider_name})
end

@spec stop_spider(module()) ::
{:ok, started_spiders()} | {:error, :spider_not_running}
def stop_spider(spider_name) do
GenServer.call(__MODULE__, {:stop_spider, spider_name})
end
Expand Down

0 comments on commit f3dd271

Please sign in to comment.