Hi Gary, Until the Sink does not call pull() automatically, and it will not receive an onPush without explicitly pulling its upstream first - this is the backpressure part.
You can simply call pull(in) by overriding preStart() and calling it from there. This is not done automatically by the framework because a Sink might do arbitrary amount of asynchronous initialization tasks before requesting the first element. Anyway, the general protocol is roughly: - pull a certain port - it will be answered by an onPush on that port eventually (or with a termination event) Custom sinks are definitely supported, and 90% of the built-in Sinks you use are implemented as GraphStages themselves. -Endre On Sat, Feb 20, 2016 at 2:02 AM, Gary Struthers <[email protected]> wrote: > The reference doc shows custom Sources and Flows but not Sinks. I wrote a > custom Sink with an InHandler that overrides onPush but it is never called. > I assumed that calling runWith would cause the SinkShape to pull by > default. An upstream custom Flow doesn't receive either onPush or onPull. > Are custom Sinks supported? If not, I can change it to a Flow. If they are, > what more do I need to do to make it pull? > > Thanks, > Gary > > -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: > http://doc.akka.io/docs/akka/current/additional/faq.html > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
