hi there, thanks for your answer! As far as I know Netty uses internal pool of ByteBuf. Can you show me a quick example of how obtaining, retaining and duplicating would look like as I'm not 100% familiar with the framework. Thank you!
On Sunday, 22 October 2017 07:00:34 UTC+3, Norman Maurer wrote: > > I am not sure what you are asking for honestly. If you want to do this > just decode the message by yourself and write the same ´ByteBuf´ to > multiple channels. Just be sure you correctly retain and duplicate it. > > On 18. Oct 2017, at 16:48, [email protected] <javascript:> wrote: > > Imagine the following scenario: > There are multiple clients and same message is dispatched to all of them. > Now the message can be a single string, or, it can be a more complex object. > Since the MessageToByteEncoder.encode's output will result in the same > byte buffer each and every time, why not actually call the operation just > once and then write that out buffer to each channel. > > This is important not only for sparing some system resource. Also imagine > I have an message pool that I reuse, so if I decode particular message > once, I know when I can "release" it. > Otherwise I'll need to trace whether it has been written to all receiving > channels and "release" then. > > Thanks > > -- > You received this message because you are subscribed to the Google Groups > "Netty discussions" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] <javascript:>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/netty/e09ed85c-4117-48f3-80d4-34a7941dad3a%40googlegroups.com > > <https://groups.google.com/d/msgid/netty/e09ed85c-4117-48f3-80d4-34a7941dad3a%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > > > -- You received this message because you are subscribed to the Google Groups "Netty discussions" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/netty/37bf56db-54a9-4836-9479-94c8b0a9fd84%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
