workly - A really simple way to move a function or class to a web worker. 🏋️‍♀️→ 😄

  •        123

Moving a function to a worker is really simple. The above examples only work when the class/function is not dependent on the containing scope, i.e. other libraries or global objects. But, you can create a custom worker.js file and move the code in there. In the worker, you can expose your object/function/class using workly.expose method.

https://github.com/pshihn/workly#readme

Tags
Implementation
License
Platform

   




Related Projects

worker-plugin - 🐳 Adds native Web Worker bundling support to Webpack.

  •    Javascript

Automatically bundle & compile Web Workers within Webpack. The best part? That worker constructor works just fine without bundling turned on too.

promise-worker - Promise-based messaging for Web Workers and Service Workers

  •    Javascript

A small and performant library for communicating with Web Workers or Service Workers, using Promises. Post a message to the worker, get a message back. Note that you require() two separate APIs, so the library is split between the worker.js and main file. This keeps the total bundle size smaller.

react-webworker - ⚙️ Communicate with a Web Worker from React

  •    Javascript

Easy communication with a Web Worker or Service Worker from React. React component for easy communication with a Web Worker. Leverages the Render Props pattern for ultimate flexibility as well as the new Context API for ease of use. Just specify the public url to your Web Worker and you'll get access to any messages or errors it sends, as well as the postMessage handler. Also works with Service Workers.

comlink-loader - Webpack loader to offload modules to Worker threads seamlessly using Comlink.

  •    Javascript

Offload modules to Worker threads seamlessly using Comlink. The goal of comlink-loader is to make the fact that a module is running inside a Worker nearly transparent to the developer.


sw-toolbox - A collection of service worker tools for offlining runtime requests

  •    Javascript

Service Worker Toolbox provides some simple helpers for use in creating your own service workers. Specifically, it provides common caching strategies for dynamic content, such as API calls, third-party resources, and large or infrequently used local resources that you don't want precached. Service Worker Toolbox provides an expressive approach to using those strategies for runtime requests. If you're not sure what service workers are or what they are for, start with the explainer doc.

greenlet - 🦎 Move an async function into its own thread.

  •    Javascript

Move an async function into its own thread. A simplified single-function version of workerize.

puma_worker_killer - Automatically restart Puma cluster workers based on max RAM available

  •    Ruby

If you have a memory leak in your code, finding and plugging it can be a herculean effort. Instead what if you just killed your processes when they got to be too large? The Puma Worker Killer does just that. Similar to Unicorn Worker Killer but for the Puma web server. Puma worker killer can only function if you have enabled cluster mode or hybrid mode (threads + worker cluster). If you are only using threads (and not workers) then puma worker killer cannot help keep your memory in control.

sw-precache - A node module to generate service worker code that will precache specific resources so they work offline

  •    Javascript

Service Worker Precache is a module for generating a service worker that precaches resources. It integrates with your build process. Once configured, it detects all your static resources (HTML, JavaScript, CSS, images, etc.) and generates a hash of each file's contents. Information about each file's URL and versioned hash are stored in the generated service worker file, along with logic to serve those files cache-first, and automatically keep those files up to date when changes are detected in subsequent builds. Serving your local static resources cache-first means that you can get all the crucial scaffolding for your web app—your App Shell—on the screen without having to wait for any network responses.

clooney - Clooney is an actor library for the web. Use workers without thinking about workers.

  •    Javascript

Clooney is an actor (ayooo) library for the web. Classes given to Clooney will be instantiated and run in a worker, keeping the main thread responsive. ⚠️ Caveat: The class cannot rely on its surrounding scope, since it is executed in an isolated context. This might change once workers support ES6 modules.

worker-threads-pool - Easily manage a pool of Node.js Worker Threads

  •    Javascript

Easily manage a pool of Node.js Worker Threads. Number of active workers in the pool.

workerize-loader - 🏗️ Automatically move a module into a Web Worker (Webpack loader)

  •    Javascript

A webpack loader that moves a module and its dependencies into a Web Worker, automatically reflecting exported functions as asynchronous proxies.

threads.js - Easy to use, yet powerful multi-threading library for node.js and the browser.

  •    Javascript

Javascript thread library. Uses web workers when run in browsers and child processes when run by node.js. Also supports browsers which do not support web workers.You don't have to write the thread's code inline. The file is expected to be a commonjs module (so something that uses module.exports = ...), for node and browser.

stockroom - 🗃 Offload your store management to a worker easily.

  •    Javascript

Offload your store management to a worker. Stockroom seamlessly runs a Unistore store (and its actions) in a Web Worker, setting up optimized bidirectional sync so you can also use & subscribe to it on the main thread.

worker-dom - The same DOM API and Frameworks you know, but in a Web Worker.

  •    TypeScript

An in-progress implementation of the DOM API intended to run within a Web Worker. Purpose: Move complexity of intermediate work related to DOM mutations to a background thread, sending only the necessary manipulations to a foreground thread.

sw-precache-webpack-plugin - Webpack plugin that generates a service worker using sw-precache that will cache webpack's bundles' emitted assets

  •    Javascript

SWPrecacheWebpackPlugin is a webpack plugin for using service workers to cache your external project dependencies. It will generate a service worker file using sw-precache and add it to your build directory. A simple configuration example that will work well in most production environments. Based on the configuration used in create-react-app.

Bee Queue - A simple, fast, robust job/task queue for Node.js, backed by Redis

  •    Javascript

A simple, fast, robust job/task queue for Node.js, backed by Redis.Bee-Queue is meant to power a distributed worker pool and was built with short, real-time jobs in mind. A web server can enqueue a job, wait for a worker process to complete it, and return its results within an HTTP request. Scaling is as simple as running more workers.

service-workers - A collection of utilities for creating/testing/experimenting with service workers.

  •    Javascript

A collection of service worker generation tools. Configurable and forkable. A node module for generating service worker files based on provided configuration options.

awesome-service-workers - :nut_and_bolt: A collection of awesome resources for learning Service Workers

  •    

A curated collection of service worker resources. Service workers are at the heart of every progressive web app. Their persistent nature allows progressive web apps to fulfill our expectations of what an app should do. They are the missing link between what only native apps could do and what modern progressive web apps can do.