-
So going through the docs there is still a note that Web Workers can only use the standard lib. I suspect this is no longer the case though since the adapting the from anvil_extras.storage import indexed_db
results_store = indexed_db.create_store("results")
def fib(num):
global store
a, b = 1, 0
i = 0
print(worker) # worker is a global object injected into worker module
while i < num:
a, b = a + b, a
i += 1
worker.task_state["i"] = i
# Store the value in indexed_db
results_store[i] = a
return b |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think it should really say that it can't use anvil modules. But I think it can use some of them, or at least I remember writing partial implantations of some of the modules. |
Beta Was this translation helpful? Give feedback.
I think it should really say that it can't use anvil modules. But I think it can use some of them, or at least I remember writing partial implantations of some of the modules.
Any pure python code in the app or dependencies should be ok. Anvil-extras being one of them.