reactor / reactor-core

Non-Blocking Reactive Foundation for the JVM

Home Page:http://projectreactor.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What's the essence of interface Fuseable?

zhanghaolong opened this issue · comments

I have been thinking the interface fuseable for a long time and I have searched a lot of websites failing to find some detailed explanation for interface Fuseable.

/** Indicates the QueueSubscription can't support the requested mode. /
int NONE = 0;
/
* Indicates the QueueSubscription can perform sync-fusion. /
int SYNC = 1;
/
* Indicates the QueueSubscription can perform only async-fusion. /
int ASYNC = 2;
/
* Indicates the QueueSubscription should decide what fusion it performs (input only). */
int ANY = 3;

Documentation Issue

Can authors please supply more information about the function of the interface Fuseable and different requested mode's influence to developers?

Improvement Suggestion

Additional context

Hello, @zhanghaolong!

Thanks for asking. Fusion is internal flag interfaces that indicates that particular source Publisher or intermediate operator support additional optimisation mechanisms. Majorly mechanism of sharing Queue so we don't allocate extra when it is possible to reuse queue of the upstream. We don't go into much details of that concept in our documentation since this is majorly internal feature but you may read more about it from the main idea creator David Karnok at his blog

Hello, @zhanghaolong!

Thanks for asking. Fusion is internal flag interfaces that indicates that particular source Publisher or intermediate operator support additional optimisation mechanisms. Majorly mechanism of sharing Queue so we don't allocate extra when it is possible to reuse queue of the upstream. We don't go into much details of that concept in our documentation since this is majorly internal feature but you may read more about it from the main idea creator David Karnok at his blog

Thanks a lot for your explanation. It helps me a lot ! I seem to get something from this Fuseable design. Thanks again!

This might be considered as duplicate of #2349. Closing in favour of the earlier one.