Skip to content

Commit

Permalink
Merge 8de476a into 4e476a2
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziinc committed Dec 11, 2019
2 parents 4e476a2 + 8de476a commit dd85077
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/crawly/engine.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ defmodule Crawly.Engine do

use GenServer

@type t :: %__MODULE__{started_spiders: started_spiders()}
@type started_spiders() :: %{optional(module()) => identifier()}

defstruct started_spiders: %{}

def start_spider(spider_name) do
Expand All @@ -18,6 +21,7 @@ defmodule Crawly.Engine do
GenServer.call(__MODULE__, {:stop_spider, spider_name})
end

@spec running_spiders() :: started_spiders()
def running_spiders() do
GenServer.call(__MODULE__, :running_spiders)
end
Expand All @@ -26,6 +30,7 @@ defmodule Crawly.Engine do
GenServer.start_link(__MODULE__, [], name: __MODULE__)
end

@spec init(any) :: {:ok, __MODULE__.t()}
def init(_args) do
{:ok, %Crawly.Engine{}}
end
Expand Down

0 comments on commit dd85077

Please sign in to comment.