     end
   end
 
+  @remote_timeout 4000
   def handle_in("public_timeline", _params, socket) do
     user = socket.assigns.user
     servers = if is_nil(user) do

            :timeout -> {:timeout, host}
            _ -> {:error, host}
          end
        _ -> :error
      end
    end)
    posts = Task.await(task)

      posts = Post.public_timeline()
              |> Repo.all()
    end)
    response = Enum.map(servers, fn %{host: host} ->
      task = Task.async(fn ->
        resp = Share.Remote.Message.create(host, "public_timeline")
               |> Share.Remote.RequestServer.request()
        resp
      end)
      {task, host}
    end)
    |> Enum.map(fn {task, host} ->
      case Task.yield(task, @remote_timeout) || Task.shutdown(task) do
        {:ok, resp} ->
          case resp do
            %{"payload" => %{"posts" => posts}} ->
              posts = Task.async_stream(posts, fn post ->
