Examples of Worker


Examples of pymontecarlo.program.xpp.Worker

     *            arguments passed to the program
     * @throws Exception
     *             if an exception occurs while executing the program
     */
    public static void main(String[] inargs) throws Exception {
        Worker worker = new Worker();
        main(worker, inargs);
    }
View Full Code Here

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
Copyright © 2018 www.massapi.com. 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.