Open samuelgoto opened 6 years ago
I'm wondering if fork() is a good analogy of what you are trying to accomplish:
if (fork()) { // executes in the parent } else { // executes in the child // communicates with the parent through pipes }
Interestingly, though:
Surprisingly, though:
Exactly how that translates to javascript is unclear, but here are a few ideas along these lines:
if (fork()) { // code runs in a worker and doesn't share memory }
or maybe
fork() { // maybe this looks different/weird enough that would give the right // signal of what's going on? }
new Worker() { // ... }
Here is what it could look like in locu:
<button onclick="fork() { localStorage.write('expansive!') }">write</button>
maybe this is too much to ask and hard to make the distinction, but hey, at least there is "some" precedence :)
How about fork { ... }, which would act like do { ... } except it would return a Promise for a structured-clone version of the result?
fork { ... }
do { ... }
I'm wondering if fork() is a good analogy of what you are trying to accomplish:
Interestingly, though:
Surprisingly, though:
Exactly how that translates to javascript is unclear, but here are a few ideas along these lines:
or maybe
or maybe
Here is what it could look like in locu:
maybe this is too much to ask and hard to make the distinction, but hey, at least there is "some" precedence :)