Skip to content

Commit

Permalink
Migrate runtime APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
HindujaB committed Nov 15, 2024
1 parent 7ff50f2 commit 626b2ec
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 33 deletions.
42 changes: 21 additions & 21 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
org.gradle.caching=true
group=io.ballerina.stdlib
version=1.13.0-SNAPSHOT
ballerinaLangVersion=2201.10.0-20241019-091600-89e54c08
ballerinaLangVersion=2201.11.0-20241112-214900-6b80ab87

puppycrawlCheckstyleVersion=10.12.0
testngVersion=7.6.1
Expand All @@ -14,35 +14,35 @@ downloadPluginVersion=5.4.0
releasePluginVersion=2.8.0

# Direct Dependencies
stdlibIoVersion=1.6.2-20240928-084100-656404f
stdlibRandomVersion=1.5.1-20240930-193000-e5c6c0e
stdlibTimeVersion=2.5.1-20240930-120200-e59222b
stdlibUrlVersion=2.4.1-20240930-120200-b7fb9e1
stdlibCryptoVersion=2.7.3-20240930-132000-5ecc9ab
stdlibLogVersion=2.10.1-20240930-154200-5ab2aa4
stdlibMimeVersion=2.10.1-20241009-141200-8b6c9f0
stdlibUuidVersion=1.8.1-20241009-134600-a05012b
stdlibHttpVersion=2.13.0-20241022-163700-67b6515
stdlibIoVersion=1.6.2-20241112-233100-995cf5f
stdlibRandomVersion=1.5.1-20241113-122300-1bc770e
stdlibTimeVersion=2.6.0-20241113-073800-201b904
stdlibUrlVersion=2.4.1-20241113-073900-335ff51
stdlibCryptoVersion=2.7.3-20241113-081400-d015a39
stdlibLogVersion=2.10.1-20241113-120000-4577868
stdlibMimeVersion=2.10.2-20241113-154200-d953747
stdlibUuidVersion=1.8.1-20241113-154400-443c67b
stdlibHttpVersion=2.13.0-20241114-182900-7e9f66a

# Transitive Dependencies

# Level 01
stdlibConstraintVersion=1.5.1-20240930-123400-5ecd396
stdlibConstraintVersion=1.6.0-20241113-090900-d276ad5

# Level 02
stdlibOsVersion=1.8.1-20241001-120600-dd1626e
stdlibTaskVersion=2.5.1-20241002-145700-5bdb843
stdlibOsVersion=1.8.1-20241113-122000-cca973b
stdlibTaskVersion=2.5.1-20241113-123500-f905281

# Level 03
stdlibCacheVersion=3.8.1-20241007-154900-63f4403
stdlibFileVersion=1.10.1-20241007-160900-03f7b64
stdlibCacheVersion=3.8.1-20241113-125700-b75a1bf
stdlibFileVersion=1.10.1-20241113-151700-e1a2e38

# Level 04
stdlibAuthVersion=2.12.1-20241010-130800-733dbef
stdlibDataJsonDataVersion=0.3.0-20241105-101100-661d11f
stdlibJwtVersion=2.13.1-20241010-123600-5ea6a94
stdlibOAuth2Version=2.12.1-20241010-123600-0e0cfcc
stdlibAuthVersion=2.12.1-20241113-162300-ded40eb
stdlibDataJsonDataVersion=0.3.0-20241114-143900-285d739
stdlibJwtVersion=2.13.1-20241113-162400-b59ccfa
stdlibOAuth2Version=2.12.1-20241113-162400-4c6ddfe

# Ballerinax Observe
observeVersion=1.3.1-20241007-161000-645452d
observeInternalVersion=1.3.1-20241015-172900-cdc3cb3
observeVersion=1.4.0-20241113-092000-b83ae74
observeInternalVersion=1.3.1-20241113-101700-265054d
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@

import io.ballerina.runtime.api.Environment;
import io.ballerina.runtime.api.Module;
import io.ballerina.runtime.api.TypeTags;
import io.ballerina.runtime.api.async.StrandMetadata;
import io.ballerina.runtime.api.concurrent.StrandMetadata;
import io.ballerina.runtime.api.creators.ValueCreator;
import io.ballerina.runtime.api.types.IntersectionType;
import io.ballerina.runtime.api.types.MethodType;
import io.ballerina.runtime.api.types.ObjectType;
import io.ballerina.runtime.api.types.Parameter;
import io.ballerina.runtime.api.types.Type;
import io.ballerina.runtime.api.types.TypeTags;
import io.ballerina.runtime.api.utils.StringUtils;
import io.ballerina.runtime.api.utils.TypeUtils;
import io.ballerina.runtime.api.values.BArray;
Expand Down Expand Up @@ -203,18 +203,11 @@ private static Object invokeRemoteFunction(Environment env, BObject bHubService,
return env.yieldAndRun(() -> {
CompletableFuture<Object> balFuture = new CompletableFuture<>();
Module module = ModuleUtils.getModule();
StrandMetadata metadata = new StrandMetadata(module.getOrg(), module.getName(), module.getVersion(),
parentFunctionName);
ObjectType serviceType = (ObjectType) TypeUtils.getReferredType(TypeUtils.getType(bHubService));
Object result;
boolean isIsolated = serviceType.isIsolated() && serviceType.isIsolated(remoteFunctionName);
StrandMetadata metadata = new StrandMetadata(isIsolated, null);
try {
if (serviceType.isIsolated() && serviceType.isIsolated(remoteFunctionName)) {
result = env.getRuntime().startIsolatedWorker(bHubService, remoteFunctionName, null, metadata,
null, args).get();
} else {
result = env.getRuntime().startNonIsolatedWorker(bHubService, remoteFunctionName, null,
metadata, null, args).get();
}
Object result = env.getRuntime().callMethod(bHubService, remoteFunctionName, metadata, args);
ModuleUtils.notifySuccess(balFuture, result);
return ModuleUtils.getResult(balFuture);
} catch (BError bError) {
Expand Down

0 comments on commit 626b2ec

Please sign in to comment.