-
can I run nats.deno in a browser worker, under deno.worker ? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 6 replies
-
Haven't tried it but if you enable the Deno namespaces to work on the worker, my guess is yes. |
Beta Was this translation helpful? Give feedback.
-
@unicomp21 This is exactly what i was planning too. Did you have any luck running i in a browser worker ? |
Beta Was this translation helpful? Give feedback.
-
@unicomp21 do you mean running like this ? https://deno.land/manual@v1.31.2/runtime/workers |
Beta Was this translation helpful? Give feedback.
-
I don't know the current state of things on the deno side, my current focus is on using esfx w/ webpack. |
Beta Was this translation helpful? Give feedback.
-
@unicomp21 and @gedw99 nats.deno doesn't run in a browser. But nats.ws does! - the API is exactly the same. As for running in a worker, I have not tried running nats.ws in a worker, but Deno most certainly does. https://github.com/aricart/services_demo/blob/main/service-adm.ts#L204 |
Beta Was this translation helpful? Give feedback.
You can call
connect()
from a worker and effectively that is an independent connection parallelizing within the same process. In my apps I have used multiple workers each with its own connection.