Package rx.Scheduler

Examples of rx.Scheduler.Worker


        }, s);
    }

    public static <T> HystrixFuture<T> from(final Action1<Promise<T>> action, Scheduler s) {
        final Promise<T> p = Promise.create();
        final Worker worker = s.createWorker();
        worker.schedule(new Action0() {

            @Override
            public void call() {
                try {
                    action.call(p);
                } catch (Exception e) {
                    p.onError(e);
                } finally {
                    worker.unsubscribe();
                }
            }

        });
        return HystrixFuture.create(p, new Action0() {

            @Override
            public void call() {
                worker.unsubscribe();
            }

        });
    }
View Full Code Here

TOP

Related Classes of rx.Scheduler.Worker

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.