GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - mkloubert/nativescript-tasks: NativeScript module for simply invoking and handling background tasks via web workers.

This repository was archived by the owner on Jan 24, 2021. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
demo
demo
 
 
plugin
plugin
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

npm npm

NativeScript Tasks

A NativeScript module for simply handling background tasks via web workers.

Donate

License

MIT license

Platforms

  • Android
  • iOS

Requirements

  • NativeScript 2.4+ (s. Multithreading Model)

Installation

Run

tns plugin add nativescript-tasks

inside your app project to install the module.

Example

import Tasks = require("nativescript-tasks");

Tasks.startNew((ctx) => {
                   return 23979 + ctx.state;
               },
               5979)  // 5979 will be stored in 'state'
                      // property of 'ctx' 
     .then((result) => {
               console.log('Result: ' + result.data);  // 29958
               // result.state = 5979
           })
     .catch((result) => {
               console.log('ERROR: ' + result.error);
               // result.state = 5979
            });

Limitations

  • You can only submit and return serializable objects and values!
  • All task functions are 'closures', what means that you CANNOT access variables or modules outside such functions. All functions are serialized as strings and submitted to the worker script where "external stuff" is NOT available! The only way to share data with the functions is to submit an optional and serializable "state value".

Read the official documentation to get more information.

About

NativeScript module for simply invoking and handling background tasks via web workers.

Resources

Readme
MIT license
Activity

Stars

12 stars

Watchers

0 watching

Forks

4 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.