WebReflection / coincident

An Atomics based Proxy to simplify, and synchronize, Worker related tasks.
MIT License
203 stars 3 forks source link

coincident doesn't support objects from python side? #20

Closed bugzpodder closed 1 year ago

bugzpodder commented 1 year ago
def foo():
  pass

xworker.sync.obj = { "foo": foo }

and in main thread foocannot be called. also doesn't work if obj is a module The only that worked is: xworker.sync.foo = foo or setattr(xworker.sync, "foo", foo)

WebReflection commented 1 year ago

this module has nothing to do with Python. In polyscript there is a transform that is interpreter dependent and it's used to automatically transform parameters when the interpreter supports it. If you want to pass Python to JS you need to use the interpreter ability to do so, which is documented in Pyodide via to_js().