Kite Config Io Worker Extension
The generated browser Web Worker helper, inside kiteConfig { web { ioWorker { ... } } }.
kiteConfig {
web {
ioWorker {
targets("js")
packageName = "com.acme.app.generated"
}
}
}Opening this block turns generation on. KiteConfig then writes a kiteConfigOffload function into each listed target's source set, so the plain js target gets it in jsMain. The function runs one JavaScript job on a throwaway worker, waits for the answer, and terminates the worker.
This is a small browser helper, not Dispatchers.IO and not a cross-platform worker runtime. It needs the browser Worker, Blob, and object-URL APIs, so Node.js-only targets and wasmJs are unsupported. You also add kotlinx-coroutines-core yourself: KiteConfig never adds a dependency for you.
The helper executes raw JavaScript source as code. Only pass source you wrote and trust, never anything built from user-controlled data. The deployed Content Security Policy must allow Blob workers too, normally with worker-src blob:.
Before this compiles in your app
| You must | Because |
|---|---|
| name a browser target with targets | browser capability is never inferred |
add kotlinx-coroutines-core yourself | the generated code suspends, and KiteConfig adds no dependencies |
allow worker-src blob: in your CSP | the worker is created from a Blob URL |
What it is not
| Not | Instead |
|---|---|
Dispatchers.IO | one job, one throwaway worker, no pool |
| a cross-platform API | browser Kotlin/JS only |
| a typed transport | strings in, strings out |
See also
for the enclosing block.