Skip to content

Question / feature request: hooks around call? #111

@blocknotes

Description

@blocknotes

Hey :)
I wonder if there is a way to execute some callback code before / after / around the call method of an actor.

My use case is the following:

  • I have an actor which plays actors in a sequence (is this a playbook? an orchestrator? something else?)
  • My actors inherit from ApplicationActor (which simply has include ServiceActor::Base)
  • I need to log the execution of each actor.

I tried to add to ApplicationActor the following:

  class << self
    def call(**args)
      ActiveSupport::Notifications.instrument("ApplicationActor", extra: self) do
        super
      end
    end
  end

but it gets executed only on the call of the "main" actor.

Any idea?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions