Skip to content

feature(async): support async func in action and manual to close child worker - #16

Open
GitHubJiKe wants to merge 3 commits into
israelss:support-async-postfrom
GitHubJiKe:support-async-post
Open

feature(async): support async func in action and manual to close child worker#16
GitHubJiKe wants to merge 3 commits into
israelss:support-async-postfrom
GitHubJiKe:support-async-post

Conversation

@GitHubJiKe

Copy link
Copy Markdown

To resolve issues: setInterval dosen't work of vue-worker, add async way to handle action's func

@GitHubJiKe

GitHubJiKe commented Feb 9, 2022

Copy link
Copy Markdown
Author

example code:

SWorker.run(async () => {
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve('SWorker run 1: Function in other thread')
    }, 2000)
  });
})
  .then((res)=>{
console.log(res.data);
setTimeout(()=>{
    res.close();// after 3 seconds close the running worker
},3000)
}) // logs 'SWorker run 1: Function in other thread'
  .catch(console.error) // logs any possible error

@israelss
israelss changed the base branch from master to support-async-post March 28, 2022 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant