All Projects → fabriciovergara → React Native Workers

fabriciovergara / React Native Workers

Licence: apache-2.0
Do heavy data process outside of your UI JS thread.

Programming Languages

java
68154 projects - #9 most used programming language
js
455 projects

Projects that are alternatives of or similar to React Native Workers

go-worker-thread-pool
A visual working example of a Thread Pool pattern, based on a known blog article.
Stars: ✭ 24 (-78.95%)
Mutual labels:  thread, parallel, workers
YACLib
Yet Another Concurrency Library
Stars: ✭ 193 (+69.3%)
Mutual labels:  thread, parallel
IPpy
🚀 Ping IP addresses and domains in parallel to find the accessible and inaccessible ones.
Stars: ✭ 54 (-52.63%)
Mutual labels:  parallel, workers
zmq
ZeroMQ based distributed patterns
Stars: ✭ 27 (-76.32%)
Mutual labels:  parallel, workers
Preact Worker Demo
Demo of preact rendering an entire app in a Web Worker.
Stars: ✭ 204 (+78.95%)
Mutual labels:  thread, workers
bascomtask
Lightweight parallel Java tasks
Stars: ✭ 49 (-57.02%)
Mutual labels:  thread, parallel
noroutine
Goroutine analogue for Node.js, spreads I/O-bound routine calls to utilize thread pool (worker_threads) using balancer with event loop utilization. 🌱
Stars: ✭ 86 (-24.56%)
Mutual labels:  parallel, workers
Raftlib
The RaftLib C++ library, streaming/dataflow concurrency via C++ iostream-like operators
Stars: ✭ 717 (+528.95%)
Mutual labels:  parallel, thread
React Native Threads
Create new JS processes for CPU intensive work
Stars: ✭ 527 (+362.28%)
Mutual labels:  thread, workers
Hamsters.js
100% Vanilla Javascript Multithreading & Parallel Execution Library
Stars: ✭ 517 (+353.51%)
Mutual labels:  parallel, thread
Python Parallel Programming Cookbook Cn
📖《Python Parallel Programming Cookbook》中文版
Stars: ✭ 978 (+757.89%)
Mutual labels:  parallel, thread
Gush
Fast and distributed workflow runner using ActiveJob and Redis
Stars: ✭ 894 (+684.21%)
Mutual labels:  parallel, workers
Pelagia
Automatic parallelization (lock-free multithreading thread) tool developed by Surparallel Open Source.Pelagia is embedded key value database that implements a small, fast, high-reliability on ANSI C.
Stars: ✭ 1,132 (+892.98%)
Mutual labels:  parallel, thread
Livestream Kt
LiveStream is a simple class which makes communication easy among different modules of your application.
Stars: ✭ 92 (-19.3%)
Mutual labels:  thread
Doazureparallel
A R package that allows users to submit parallel workloads in Azure
Stars: ✭ 102 (-10.53%)
Mutual labels:  parallel
Service
Service encapsulates an object which executes a bit of code in a loop that can be started or stopped and query whether it is running or not.
Stars: ✭ 86 (-24.56%)
Mutual labels:  thread
Redrun
✨🐌 🐎✨ fastest npm scripts runner
Stars: ✭ 85 (-25.44%)
Mutual labels:  parallel
Index
Metarhia educational program index 📖
Stars: ✭ 2,045 (+1693.86%)
Mutual labels:  parallel
Parallel Process
🏃 Run multiple processes simultaneously
Stars: ✭ 102 (-10.53%)
Mutual labels:  parallel
Ngx Papaparse
Papa Parse wrapper for Angular
Stars: ✭ 83 (-27.19%)
Mutual labels:  workers

NO LONGER MAINTAINED

Please consider using instead: https://github.com/joltup/react-native-threads

react-native-workers (RN 0.43^)

Do heavy data process outside of your UI JS thread.

Before using this kind of solution you should check if InteractionManager.runAfterInteractions is not enough for your needs, because creating a aditional worker can considerably increase app memory usage.

I mostly use this library for a personal project, that wrap a native database with a graphql api. So the updates may follow my needs, but any PR is welcome.

Automatic Instalation

npm install --save rn-workers
react-native link rn-workers

Or Install manually

Prepare your project following this SETUP GUIDE

App side

    //index.ios.js 
    import { Worker } from 'rn-workers'

    export default class rnapp extends React.Component {

        componentDidMount () {
            //Create using default worker port (8082)
            this.worker = new Worker();
            
            //Create worker pointing to custom one
            this.worker2 = new Worker(8083);
            
            
            //Add listener to receve messages
            this.worker.onmessage = message => this.setState({
                 text: message,
                 count: this.state.count + 1
            });

            //Send message to worker (Only strings is allowed for now)
            this.worker.postMessage("Hey Worker!")
        }

        componentWillUnmount () {
            //Terminate worker
            this.worker.terminate();
        }
        
        (...)
     }

Worker side

    //index.worker.js
    import { WorkerService } from 'rn-workers'
    
    const worker = new WorkerService();
    worker.onmessage = message => {
        //Reply the message back to app
        worker.postMessage("Hello from the other side (" + message + ")")
    };

Aditional Information

License

Cancer GPL ..... just kindind, its Apache 2.0

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].