@@ -13,7 +13,7 @@ var __publicField = (obj, key, value) => {
13
13
var constants_exports = { } ;
14
14
__export ( constants_exports , {
15
15
ErrorMessage : ( ) => ErrorMessage ,
16
- ExternFunctionReturnType : ( ) => ExternFunctionReturnType ,
16
+ ExternReturnType : ( ) => ExternReturnType ,
17
17
ModuleExt : ( ) => ModuleExt ,
18
18
TaskType : ( ) => TaskType ,
19
19
ThreadMessageType : ( ) => ThreadMessageType ,
@@ -87,15 +87,16 @@ var defaultConcurrencySettings = Object.assign(
87
87
var ModuleExt = /* @__PURE__ */ ( ( ModuleExt2 ) => {
88
88
ModuleExt2 [ "WASM" ] = ".wasm" ;
89
89
ModuleExt2 [ "SO" ] = ".so" ;
90
+ ModuleExt2 [ "PY" ] = ".py" ;
90
91
return ModuleExt2 ;
91
92
} ) ( ModuleExt || { } ) ;
92
- var ExternFunctionReturnType = /* @__PURE__ */ ( ( ExternFunctionReturnType2 ) => {
93
- ExternFunctionReturnType2 [ ExternFunctionReturnType2 [ "ArrayBuffer" ] = 0 ] = "ArrayBuffer" ;
94
- ExternFunctionReturnType2 [ ExternFunctionReturnType2 [ "Boolean" ] = 1 ] = "Boolean" ;
95
- ExternFunctionReturnType2 [ ExternFunctionReturnType2 [ "Number" ] = 2 ] = "Number" ;
96
- ExternFunctionReturnType2 [ ExternFunctionReturnType2 [ "String" ] = 3 ] = "String" ;
97
- return ExternFunctionReturnType2 ;
98
- } ) ( ExternFunctionReturnType || { } ) ;
93
+ var ExternReturnType = /* @__PURE__ */ ( ( ExternReturnType2 ) => {
94
+ ExternReturnType2 [ ExternReturnType2 [ "ArrayBuffer" ] = 0 ] = "ArrayBuffer" ;
95
+ ExternReturnType2 [ ExternReturnType2 [ "Boolean" ] = 1 ] = "Boolean" ;
96
+ ExternReturnType2 [ ExternReturnType2 [ "Number" ] = 2 ] = "Number" ;
97
+ ExternReturnType2 [ ExternReturnType2 [ "String" ] = 3 ] = "String" ;
98
+ return ExternReturnType2 ;
99
+ } ) ( ExternReturnType || { } ) ;
99
100
100
101
// libs/platform/src/core/utils.ts
101
102
function isBoolean ( val ) {
@@ -154,11 +155,17 @@ function createObject(properties) {
154
155
return obj ;
155
156
}
156
157
function isNativeModule ( moduleSrc ) {
157
- if ( moduleSrc . endsWith ( ".wasm" /* WASM */ ) || moduleSrc . endsWith ( ".so" /* SO */ ) )
158
+ if ( moduleSrc . endsWith ( ".wasm" /* WASM */ ) || moduleSrc . endsWith ( ".so" /* SO */ ) || moduleSrc . endsWith ( ".py" /* PY */ ) )
158
159
return false ;
159
160
else
160
161
return true ;
161
162
}
163
+ function isExternModule ( moduleSrc ) {
164
+ if ( moduleSrc . endsWith ( ".so" /* SO */ ) || moduleSrc . endsWith ( ".py" /* PY */ ) )
165
+ return true ;
166
+ else
167
+ return false ;
168
+ }
162
169
163
170
// libs/platform/src/core/error.ts
164
171
var ConcurrencyError = class extends Error {
@@ -284,7 +291,7 @@ var ConcurrentModule = class {
284
291
if ( ! Reflect . has ( cache , key ) ) {
285
292
const threadedFunction = new ThreadedFunction ( thread , moduleSrc , key ) ;
286
293
Reflect . set ( cache , key , ( ...params ) => {
287
- if ( moduleSrc . endsWith ( ".so" /* SO */ ) )
294
+ if ( isExternModule ( moduleSrc ) )
288
295
return threadedFunction . invoke ( [ params , self . options . extern ] ) ;
289
296
else
290
297
return threadedFunction . invoke ( params ) ;
0 commit comments