thought of better syntax like When():Event(eventName, function)
and When():Listening(eventName, function) or something
but otherwise seems cool!
0.1.0 Extensions
From 0.0.1 to 0.1.0, this update is a big leap as it allows you to curate which features should be on the library just so you can have a peace of mind on the balance of optimization, simplicity, and usefulness. For more information, read the changelog for 0.1.0.
To obtain the model, download the rbxm directly or from the Roblox library.
Example usage of a built-in extension
local When = game:GetService("ReplicatedStorage")
local when = require("When")
when.extend(When.Extensions.Interoperable)
local event = when.new()
when.publish(event, "MyFirstPublishedEvent")
-- You can now retrieve the event from another script
I had a thought on this but this wouldn’t be practical as this rather focus on BindableEvents in form of scripting interface to retain familiarity (and since people over obsess over “OOP”). Doing this would just not be practical, but great suggestion!
I feel I should probably address this benchmark, it seems quite off. I believe the dev ran this benchmark with Deferred mode enabled, both GoodSignal and LemonSignal are Immediate mode only. FastSignal automatically uses Deferred mode if you have it set in your game, this naturally causes worse performance due to the lack of thread recycling. Otherwise, because of the double-ended linked list used, :Connect
calls and deviratives (:Wait
, :Once
) are slower, but :Disconnect
is faster, and firing should be the same perf as GoodSignal, not 3x slower like shown here, this is the same with Lemon. I don’t have the Benchmarker plugin, but from the benchmarks I did, while on Immediate mode, they perform quite similarly, like margin of error.