Search in sources :

Example 1 with InitWorkerResponseContext

use of org.ballerinalang.bre.bvm.InitWorkerResponseContext in project ballerina by ballerina-lang.

the class BLangFunctions method executeInitWorker.

private static WorkerData executeInitWorker(WorkerExecutionContext parentCtx, int[] argRegs, CallableUnitInfo callableUnitInfo, WorkerInfo workerInfo, WorkerDataIndex wdi) {
    InitWorkerResponseContext respCtx = new InitWorkerResponseContext(parentCtx);
    WorkerExecutionContext ctx = executeWorker(respCtx, parentCtx, argRegs, callableUnitInfo, workerInfo, wdi, null, null, true);
    BLangScheduler.executeNow(ctx);
    WorkerData workerLocal = ctx.workerLocal;
    if (respCtx.isErrored()) {
        return null;
    } else {
        return workerLocal;
    }
}
Also used : WorkerExecutionContext(org.ballerinalang.bre.bvm.WorkerExecutionContext) InitWorkerResponseContext(org.ballerinalang.bre.bvm.InitWorkerResponseContext) WorkerData(org.ballerinalang.bre.bvm.WorkerData)

Aggregations

InitWorkerResponseContext (org.ballerinalang.bre.bvm.InitWorkerResponseContext)1 WorkerData (org.ballerinalang.bre.bvm.WorkerData)1 WorkerExecutionContext (org.ballerinalang.bre.bvm.WorkerExecutionContext)1