Announcement: Tencent Cloud Mini Program Platform Renamed to Tencent Cloud Super App as a Service on January 2, 2025
Console Updates
Android SDK Updates
iOS SDK Updates
Flutter SDK Updates
IDE Updates
Base Library Updates
// Create a normal workerconst worker = wx.createWorker('workers/index.js') // Specify the worker's entry file absolute pathworker.onMessage(function (res) {console.log(res)})worker.postMessage({msg: 'hello worker'})worker.terminate()
Property | Type | Description |
USER_DATA_PATH | string | The path to the user directory in the file system (local path). |
Property | Type | Description |
message | Object | Messages sent by the main/Worker thread to the current thread. |
worker.postMessage({msg: 'hello from worker'})
const worker = wx.createWorker('workers/request/index.js')worker.postMessage({msg: 'hello from main'})
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback