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?
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:
ApplicationActor(which simply hasinclude ServiceActor::Base)I tried to add to
ApplicationActorthe following:but it gets executed only on the call of the "main" actor.
Any idea?