在这个博客中,他给出了这个(复制/粘贴以下代码)回调地狱的例子.但是,没有提到如何使用Reactive Extensions消除该问题.
所以这里F3取决于F1完成,F4和F5取决于F2完成.
注意:我目前正试图绕过Rx,所以在问这个问题之前我没有尝试解决这个例子.
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
public class CallbackB {
    /**
     * Demonstration of nested callbacks which then need to composes their responses together.
     * <p>
     * Various different approaches for composition can be done but eventually they end up relying upon
     * synchronization techniques such as the CountDownLatch used here or converge on callback design
     * changes similar to <a href="https://github.com/Netflix/RxJava">Rx</a>.
     */ …我一直听到很多关于功能反应式编程的知识,并决定查看重要的是什么.通过bacon.js文档,似乎主要区别在于,不是在组件上设置事件侦听器,而是在其上创建事件流,并将事件处理程序传递到流中.换句话说,我真正做的就是将事件处理程序从组件移动到事件流.是吗?如果是这样,这样做的最大好处是什么?
javascript functional-programming event-handling frp bacon.js