Package com.cloudbees.groovy.cps

Examples of com.cloudbees.groovy.cps.Next


    /**
     * Creates a brand-new thread that evaluates 'b'.
     */
    GreenThreadState(GreenThread g, Block b) {
        // TODO: allow the caller to pass a value
        this(g,new Next(b, new FunctionCallEnv(null, HALT, null, null), HALT));
    }
View Full Code Here


    /**
     * Creates a {@link GreenThreadState} that's already dead.
     */
    GreenThreadState(GreenThread g, Outcome v) {
        this(g,new Next(null,HALT,v));
    }
View Full Code Here

    /**
     * Creates a brand-new thread that evaluates 'b'.
     */
    GreenThreadState(GreenThread g, Block b) {
        // TODO: allow the caller to pass a value
        this(g,new Next(b, Envs.empty(), HALT));
    }
View Full Code Here

    /**
     * Creates a {@link GreenThreadState} that's already dead.
     */
    GreenThreadState(GreenThread g, Outcome v) {
        this(g,new Next(null,HALT,v));
    }
View Full Code Here

        }
    };


    Next asNext(Outcome y) {
        if (y==null)    return new Next(b,e,k);
        else            return new Next(e,k,y);
    }
View Full Code Here

* @see ContinuationPtr
* @author Kohsuke Kawaguchi
*/
abstract class ContinuationGroup implements Serializable {
    public Next then(Block exp, Env e, ContinuationPtr ptr) {
        return new Next(exp,e,ptr.bind(this));
    }
View Full Code Here

    public Next then(Block exp, Env e, ContinuationPtr ptr) {
        return new Next(exp,e,ptr.bind(this));
    }

    public Next then(Block exp, Env e, Continuation k) {
        return new Next(exp,e,k);
    }
View Full Code Here

        this.exp1 = exp1;
        this.exp2 = exp2;
    }

    public Next eval(final Env e, final Continuation k) {
        return new Next(exp1,e, new ContinuationImpl(e, k, exp2));
    }
View Full Code Here

            this.k = k;
            this.exp2 = exp2;
        }

        public Next receive(Object _) {
            return new Next(exp2, e, k);
        }
View Full Code Here

        public Next receive(final Object v) {
            // finally block should be evaluated with 'parent', not 'TryBlockEnv.this' because
            // exceptions thrown in here will not get caught by handlers we have.

            // similarly, k should receive v, not the result of the evaluation of the finally block
            return new Next(finally_, parent, new ValueBoundContinuation(k, v));
        }
View Full Code Here

TOP

Related Classes of com.cloudbees.groovy.cps.Next

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.