   def request(url, callback, from \\ self) do
     Request.async(url, callback, from)
   end
-  defdelegate await(%Request{}), to: Request
-
+
+  def await(request = %Request{}), do: Request.await(request)
   def await(spider, timeout \\ :infinity) do
-    GenServer.call(spider, :await, :infinity)
+    GenServer.call(spider, :await, timeout)
   end
 
   # GenServer callbacks

  defmacro __using__(_) do
    quote location: :keep do
      @behaviour GenSpider

      @start_urls []


    :erlang.send_after(time, dest, message)
  end

  defp call(method, %GenSpider{}=spider, nil) when is_atom(method) do
    call(method, spider, [spider.state])
  end
  defp call(method, %GenSpider{}=spider, args) when is_atom(method) do
    Kernel.apply(spider.module, method, args)
  end
end