Skip to content

after_perform hooks fire in reverse of specified order #11

Description

@opensourceame

after_perform hooks should fire in the order specified in the class. Consider:

class TestService < Servitium::Service
  context do
    input do
      attribute :something
    end
  end

  after_perform :callback_a, :callback_b, :callback_c

  def perform
    puts "perform"
  end

  def callback_a
    puts "callback_a"
  end

  def callback_b
    puts "callback_b"
  end

  def callback_c
    puts "callback_c"
  end
end

I would expect the order of the after hooks to be callback_a then callback_b then callback_c, however this is the result:

> TestService.perform(something: "test")

perform
callback_c
callback_b
callback_a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions