
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
Golems is a simple cross-platform Haxe worker system. Its goal is to make it easier for developers to benefit from Haxe's targets' concurrency features. Golems currently supports the Flash, JS, NekoVM and C++ targets, and perhaps others.
The Golems library currently includes two solutions:
BasicWorker and invoke them through a BasicBoss (usually a QuickBoss).Golem::rise lets you compile and embed workers inline into one executable.Technically, these two solutions can be used independent of one another. They may in the future be replaced or supplemented with better solutions to the same problems. Additionally, a helper class called TempAgency can be used to spin up and manage multiple threads that are performing the same operation on different data simultaneously.
BasicWorkers are simple objects containing a process function of type TInput->Null<TOutput>. They run synchronously; they do not return until they're done processing their input. Their output is sent to the main thread, and if an error occurs, that is sent to the main thread as well.
BasicBosses are the objects that maintain communication between the main thread and worker thread. Extending BasicBoss is possible, but nine times out of ten, its subclass QuickBoss will be sufficient for our needs.
Say you're writing an application that includes a utility to crunch data. One day you find that when the utility is given an especially heavy task, your application becomes unresponsive.
Rats! Well, here's something you can do.
First, create a small hxml project adjacent to your application's. This will be the workers' project. Inside, write a standard compile target description for each platform your application runs on– but prepend each one with the special comment ###GOLEM###:
##GOLEM##
-main com.whoeveryouare.app.workers.DataCruncher
-js golems/DataCruncher.js
-cp src
-lib golems
You'll want to create a class called DataCruncher, then, in the package mentioned above:
package com.whoeveryouare.app.workers;
import com.whoeveryouare.app.utils.SlowUtility;
import net.rezmason.utils.workers.BasicWorker;
class TestWorker extends BasicWorker<YourInputType, YourOutputType> {
override function process(input) return SlowUtility.crunchData(input);
}
There we go! We just wrote a worker. This will compile separately from the rest of your project. No need for a main function; Golems shove their own in. You may use a constructor, if you'd like.
To use this worker, we'll shoehorn it into your existing code:
// grab the worker once
var worker = Golem.rise('datacruncher.hxml');
// invoke the boss when you know there's work to be done
var boss = new QuickBoss(worker, onDataCrunched, onDataCrunchError);
boss.start();
// send the worker its work when you have it
boss.send(someInput);
// handle the worker's output
function onDataCrunched(crunchedData:YourOutputType) { ... }
// optionally handle the worker's errors
function onDataCrunchError(error:Dynamic) { ... }
// finally, when you're done with the worker, well...
boss.die();
boss = null;
When you build your application, Golem::rise will run the Haxe compiler against the worker project, grab the output, and assign it to the worker variable. When your code runs, the boss will create the worker, start it, communicate with it, and terminate it. Voilà! Your data will be crunched outside your application's event loop, its responsiveness will improve, and you'll be able to shift your focus to the other bugs in your code.
I suspect the current version of the library will support eighty to ninety percent of what people want from a Haxe concurrency library. Bitcoin miners, bioinformatics lab technicians and AI researchers might wish that Golems had a richer feature set, such as more nuanced communications between threads or shared memory.

Maybe Golems will become that library. I'm not only open to contributions, I would in fact like someone else to maintain it, preferably someone who uses concurrency more frequently than I do, or who is more actively involved in the Haxe community than I am.
If you're using Golems in an Adobe AIR project, your workers will be created with application sandbox privileges.
Golems is licensed under the LGPLv3. It's a real page-turner.
FAQs
Golems is a simple cross-platform Haxe worker system.
The npm package golems receives a total of 9 weekly downloads. As such, golems popularity was classified as not popular.
We found that golems demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.