An actor library for the web that runs classes in Web Workers to keep the main thread responsive.
Clooney is an actor library for the web that enables developers to run JavaScript classes in Web Workers without directly managing worker threads. It solves the problem of main thread blocking by offloading expensive computations to background threads, using Comlink under the hood for transparent communication. This allows for responsive web applications while maintaining a simple, class-based programming model.
Web developers building performance-sensitive applications that require offloading CPU-intensive tasks, such as data processing, image manipulation, or complex calculations, without diving into low-level Web Worker APIs.
Developers choose Clooney because it dramatically simplifies concurrent programming on the web by abstracting Web Workers into an intuitive actor pattern, reducing boilerplate and eliminating common pitfalls in worker communication. Its integration with Comlink ensures reliable proxying and a seamless developer experience.
Clooney is an actor library for the web. Use workers without thinking about workers.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Abstracts Web Workers into a class-based API, allowing developers to spawn actors in workers without managing threads directly, as demonstrated in the quickstart example with Clooney.spawn().
Automatically manages promises and async methods across thread boundaries, enabling natural asynchronous programming without extra boilerplate, shown in the timeoutThing() example.
Provides special handling for events and functions by converting them into transferable remoteEvent objects, making cross-thread event handling possible, as detailed in the Events and Functions section.
Offers strategies like RoundRobinStrategy to control worker container creation and distribution, optimizing resource usage for concurrent tasks with options like maxNumContainers.
Actors cannot rely on their surrounding scope due to execution in isolated workers, restricting closure usage and requiring explicit data passing, as noted in the README caveat about ES6 module support.
Depends on ES6 Proxy support, requiring polyfills for older browsers, and CDN usage involves workarounds for same-origin restrictions, adding setup complexity as shown in the CDN example.
Communication between main thread and workers involves proxying via Comlink, which can introduce latency compared to direct worker messaging for high-frequency or latency-sensitive tasks.