How to write a custom actor that also acts as an observable?

Hello,
in Rocket, I’d like to do something like this:

struct CustomActor1 <: Actor{Any}
    # Data
end

function Rocket.on_next!(a::CustomActor1, data::Any)
    #Compute using a's data
    next!() # send result downstream
end

actor1 = CustomActor1()
subscribe!(source1, actor1) 
subscribe!(source2, actor1) 

struct CustomActor2 <: Actor{Any}
end

actor2 = CustomActor2()

source3 = actor1 |> multicast()
subscribe!(source3, actor2)

Can’t wrap my head around the design.

  • proxy() seems to link Actor2 with Actor1 sources.
  • Actor1 is not a Subject as it takes different input and output.
  • Can Actor1 be both a Subscribable and an Actor given that its execution is continuous (Actor2 does not ‘own’ the execution of Actor1)