How do I invoke Pipeline.handle_info from a Phoenix.WebChannel?
I'm trying to pass audio from a Phoenix Web Channel to a Pipeline. Also, are there any
notify_child
usage examples? I don't understand how to use Membrane.Pipeline.notify_child
. Do I need to define it first? If so, what should the definition look like?
Update:
I was able to pass a message to the pipeline by making the following changes to my Channel handle_in
like so:
But I got the error:
This is what my Membrane.Pipeline.handle_info
looks like
7 Replies
Hi @Villain In Glasses
All Membrane.Pipeline and Membrane.Element callbacks need to return a tuple of Actions and the next state (as shown here)
notify_child is an action, so to use it you need to return it from the
handle_info
callback.
In your case the return value in handle_info
should probably look like this:
Thanks to this the specified child will receive the message after the handle_info
callback execution finishesOh, so that's how you use it. Thanks for the clarification.
Also, now I'm getting another error:
Is this the wrong way to define specify children?
to give your child a name that can be used to locate this child you need to explicitly specify it in the
child
function, otherwise the child will be anonymous. You could specify the name like this:
and the child would be available under name :source
Nope, I updated the code to:
I'm still getting:
handle_init has arity of 2, try
Thank you so much! That worked 😄
no problem, happy to help ;)