Search in sources :

Example 11 with BLangForkJoin

use of org.wso2.ballerinalang.compiler.tree.statements.BLangForkJoin in project ballerina by ballerina-lang.

the class BLangPackageBuilder method addTimeoutCause.

public void addTimeoutCause(Set<Whitespace> ws, String identifier) {
    BLangForkJoin forkJoin = (BLangForkJoin) this.forkJoinNodesStack.peek();
    forkJoin.timeoutBody = (BLangBlockStmt) this.blockNodeStack.pop();
    forkJoin.timeoutExpression = (BLangExpression) this.exprNodeStack.pop();
    Set<Whitespace> varWS = removeNthFromLast(ws, 3);
    forkJoin.addWS(ws);
    forkJoin.timeoutVariable = (BLangVariable) this.generateBasicVarNode((DiagnosticPos) this.typeNodeStack.peek().getPosition(), varWS, identifier, false);
}
Also used : BLangForkJoin(org.wso2.ballerinalang.compiler.tree.statements.BLangForkJoin) Whitespace(org.ballerinalang.model.Whitespace)

Example 12 with BLangForkJoin

use of org.wso2.ballerinalang.compiler.tree.statements.BLangForkJoin in project ballerina by ballerina-lang.

the class BLangPackageBuilder method addJoinCondition.

public void addJoinCondition(Set<Whitespace> ws, String joinType, List<String> workerNames, int joinCount) {
    BLangForkJoin forkJoin = (BLangForkJoin) this.forkJoinNodesStack.peek();
    forkJoin.joinedWorkerCount = joinCount;
    forkJoin.joinType = ForkJoinNode.JoinType.valueOf(joinType);
    forkJoin.addWS(ws);
    workerNames.forEach(s -> forkJoin.joinedWorkers.add((BLangIdentifier) createIdentifier(s)));
}
Also used : BLangForkJoin(org.wso2.ballerinalang.compiler.tree.statements.BLangForkJoin) BLangIdentifier(org.wso2.ballerinalang.compiler.tree.BLangIdentifier)

Aggregations

BLangEndpoint (org.wso2.ballerinalang.compiler.tree.BLangEndpoint)4 BLangForkJoin (org.wso2.ballerinalang.compiler.tree.statements.BLangForkJoin)4 UTF8CPEntry (org.wso2.ballerinalang.programfile.cpentries.UTF8CPEntry)4 SymbolEnv (org.wso2.ballerinalang.compiler.semantics.model.SymbolEnv)3 BLangWorker (org.wso2.ballerinalang.compiler.tree.BLangWorker)3 Whitespace (org.ballerinalang.model.Whitespace)2 BLangIdentifier (org.wso2.ballerinalang.compiler.tree.BLangIdentifier)2 BLangBlockStmt (org.wso2.ballerinalang.compiler.tree.statements.BLangBlockStmt)2 Operand (org.wso2.ballerinalang.programfile.Instruction.Operand)2 RegIndex (org.wso2.ballerinalang.programfile.Instruction.RegIndex)2 WorkerInfo (org.wso2.ballerinalang.programfile.WorkerInfo)2 InvokableNode (org.ballerinalang.model.tree.InvokableNode)1 BLangXMLQuotedString (org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLQuotedString)1 ForkjoinInfo (org.wso2.ballerinalang.programfile.ForkjoinInfo)1 ForkJoinCPEntry (org.wso2.ballerinalang.programfile.cpentries.ForkJoinCPEntry)1