Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specific queues to be started independently #68

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

spencerdcarlson
Copy link

@spencerdcarlson spencerdcarlson commented Nov 21, 2018

Added a manual_queue_supervisor.ex which is a clone of supervisor.ex except it takes an options keyword list as the first parameter.

Modified TaskBunny.Supervisor.start_link to take options

The options are eventually passed down to the TaskBunny.WorkerSupervisor where it checks for a list of queue names, or a namespace to start.

Consumers of the task_bunny library can disable runtime dependency which will disable the automatic start of the TaskBunny Application and then call the TaskBunny.ManualQueues TaskBunny.Supervisor manually from their umbrella application

children = [
  supervisor(
        TaskBunny.Supervisor,
        [
          TaskBunny.Supervisor,
          TaskBunny.WorkerSupervisor,
          :publisher,
          [queues: [namespace: "my-name-space"]]
        ]
      )
]
Supervisor.start_link(children, [strategy: :one_for_one, name: MyApp.Supervisor])
# disable runtime dependency to disable auto start
defp deps do
[
  {:task_bunny, "~> 0.3.2", runtime: false}
]
end

lib/task_bunny/manual_queue_supervisor.ex Outdated Show resolved Hide resolved
lib/task_bunny/worker_supervisor.ex Outdated Show resolved Hide resolved
@matelau
Copy link

matelau commented Nov 27, 2018

We should also update the readme with the new configuration options.

Copy link

@matelau matelau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good 👍

@paulstatezny
Copy link

I will definitely use this! Can't wait for it to drop.

@spencerdcarlson
Copy link
Author

I will definitely use this! Can't wait for it to drop.

@paulstatezny,
Feel free to use my fork

{:task_bunny,
       git: "[email protected]:spencerdcarlson/task_bunny.git", ref: "v1.1.0-sc", runtime: false}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants