All Projects → appcelerator-modules → Ti.worker

appcelerator-modules / Ti.worker

Licence: other
Use Multi-Threading / Worker Threads in Appcelerator Titanium.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Ti.worker

Corium
Corium is a modern scripting language which combines simple, safe and efficient programming.
Stars: ✭ 18 (-81.05%)
Mutual labels:  native, multithreading
React Native Multithreading
🧵 Fast and easy multithreading for React Native using JSI
Stars: ✭ 164 (+72.63%)
Mutual labels:  multithreading, native
Auth0 React Native Sample
Auth0 Integration Samples for React Native
Stars: ✭ 77 (-18.95%)
Mutual labels:  native
Iamport React Native
React Native용 아임포트 일반.결제 및 휴대폰 본인인증 모듈입니다.
Stars: ✭ 88 (-7.37%)
Mutual labels:  native
Napajs
Napa.js: a multi-threaded JavaScript runtime
Stars: ✭ 8,945 (+9315.79%)
Mutual labels:  multithreading
Zippyshare Scraper
A module to get direct downloadable links from zippyshare download page.
Stars: ✭ 77 (-18.95%)
Mutual labels:  multithreading
Go Concurrency
This repos has lots of Go concurrency, goroutine and channel usage and best practice examples
Stars: ✭ 84 (-11.58%)
Mutual labels:  multithreading
Multiplatform Preferences
Kotlin Multi Platform Preferences, for android an ios : SharedPreferences & NSUserDefault
Stars: ✭ 76 (-20%)
Mutual labels:  native
Facebook ssl pinning
Bypassing SSL Pinning in Facebook Android App
Stars: ✭ 95 (+0%)
Mutual labels:  native
Left Right
A lock-free, read-optimized, concurrency primitive.
Stars: ✭ 1,245 (+1210.53%)
Mutual labels:  multithreading
Android Luajit Launcher
Android NativeActivity based launcher for LuaJIT, implementing the main loop within Lua land via FFI
Stars: ✭ 87 (-8.42%)
Mutual labels:  native
Unity Experiment Framework
UXF - Framework for creating human behaviour experiments in Unity
Stars: ✭ 81 (-14.74%)
Mutual labels:  multithreading
Arcgis Appstudio Samples
Collection of samples available in AppStudio for ArcGIS desktop to learn and help build your next app.
Stars: ✭ 78 (-17.89%)
Mutual labels:  native
React Native Circle Button
A Customizable React Native Circle Button
Stars: ✭ 87 (-8.42%)
Mutual labels:  native
Delta
Programming language focused on performance and productivity
Stars: ✭ 77 (-18.95%)
Mutual labels:  native
Cipher.so
A simple way to encrypt your secure data like passwords into a native .so library.
Stars: ✭ 1,308 (+1276.84%)
Mutual labels:  native
Operating Systems
'Operating System Concepts' - Solutions to exercises and projects
Stars: ✭ 76 (-20%)
Mutual labels:  multithreading
Node Desktop Idle
Node/Electron module to detect idle desktop user (macOS, Windows, Linux, FreeBSD and OpenBSD)
Stars: ✭ 81 (-14.74%)
Mutual labels:  native
Ngx Papaparse
Papa Parse wrapper for Angular
Stars: ✭ 83 (-12.63%)
Mutual labels:  multithreading
Threads.js
🧵 Make web workers & worker threads as simple as a function call.
Stars: ✭ 1,328 (+1297.89%)
Mutual labels:  multithreading

Titanium Worker Module (EXPERIMENTAL)

This is a Titanium module that provides a Web Worker like interface to applications built with Titanium.

This module is designed to be used when applications need to process asynchronous application logic. Due to the limitations of Javascript engines; tasks will not be executed on a seperate thread, but instead executed asynchronously.

Example

The following is a trivial echo background service. In your app.js, use the following:

var worker = require('ti.worker');

// create a worker thread instance
var task = worker.createWorker('echo.js');

// subscribe to any worker thread instance messages
task.addEventListener('message',function(event){
	
	// data that is sent will be in the data property
	alert(event.data);
	
	// stop terminating this thread instance
	task.terminate();
});

// send data to the worker thread which will be posted on the threads event queue
// you can send any data here
task.postMessage({
	msg:'Hello'
});

Now, in a separate file named echo.js, use the following:

// subscribe to events send with postMessage
worker.addEventListener('message',function(event){
	
	// send data back to any subscribers
	// pull data from the event from the data property
	worker.postMessage(event.data.msg);
});

Note: the worker global variable is always defined inside the worker execution context.

API

  • postMessage - send a message to or from the worker thread. Send any data as the first argument.
  • terminate - terminate the worker thread and stop as soon as possible processing.
  • nextTick - this method is only available inside the worker instance and provides an ability to process the function passed on the next available thread event loop cycle.

Events

  • message - receive an event. The data property of the event will contain as-is any data specified as the first argument.
  • terminated - the worker thread was terminated.

Properties

The worker instance has only one property:

  • url - the url of the worker thread JS file passed in during creation.

Warning

This module is experimental and has not been finalized.

License

Copyright (c) 2012-present by Axway Appcelerator. All Rights Reserved. This code is licensed under the terms of the Apache Public License, version 2.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].