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

config.tasks.queues can be a static array or an async function that returns list of queues #1512

Merged
merged 3 commits into from Jul 1, 2020

Conversation

evantahler
Copy link
Member

This PR allows api.tasks.queues to be either a static array or an async function that returns a list of queues. This method will be called once when the server starts. In this way, you can provide custom logic to build up your list of queues for this server.

// config/tasks.ts

export const DEFAULT = {
  tasks: (config) => {
    return {
      _toExpand: false,

      // Should this node run a scheduler to promote delayed tasks?
      scheduler: false,

      // what queues should the taskProcessors work?
      queues: ["*"],
      // Or, rather than providing a static list of `queues`, you can define a method that returns the list of queues.
      queues: async () => { return ["queueA", "queueB"]; },

// ...

@evantahler
Copy link
Member Author

docs updated via actionhero/www.actionherojs.com@69577ce

@evantahler evantahler merged commit fbdcc12 into master Jul 1, 2020
@evantahler evantahler deleted the resque-custom-queues branch July 1, 2020 23:10
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.

None yet

1 participant