Skip to content

Вest way for running subscribers. #9

@ssnickolay

Description

@ssnickolay

Hi, Cody!
I am a bit confused :)
When I configured subscribex, I didn't add it to my test env's applications stack (like it was written in README). So, when I launched tests, I saw "frozen" console...
It turned out that the reason in this line this line
I added logs to this function and created PR about it.

But its not problem solution, and I wrote code similar to README:

defmodule MyApp do
  use Application

  def start(_type, _args) do
    import Supervisor.Spec

    children = [
      ...
    ] ++ subscribers(Mix.env)

    opts = [strategy: :one_for_one, name: MyApp.Supervisor]
    Supervisor.start_link(children, opts)
  end

  defp subscribers(:test), do: []
  defp subscribers(_) do
    import Supervisor.Spec
    [ worker(MySubscriber, []) ]
  end
end

What do you think about it? It is probably worth adding a certain flag test_mode and implementing different logic inside library?
Because also I don't want to install RabbitMQ to my CI container...

p/s/ and thx for this library 👍

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions