Get SomeSignal from creator store
Current release note
SomeSignal, some… mutation queue based signal with opt-in priority insertion
made by a bored person
SomeSignal shares a familarity with RBXScriptSignal and the :Fire() element of BindableEvents, but with additional features.
^ Like majority of signals, this signal is immediate rather than deferred
Works both on old and new type solver (You have to be careful on old solver as self type on signal is any)
Special thanks to @GohanDucis for helping with development of SomeSignal!
Differences to majority of signals
- While creating signal, you can specify the behavior to be
AsyncorSync
^ By default it’sAsyncto keep behavior consistent to majority of signals
local signal = require("Path to SomeSignal")("Sync")
signal:Connect(function()
print("Hello im synchronous, and im gonna wait for 2 seconds")
task.wait(2)
end)
signal:Fire()
print("Back from waiting")
- Run order being FIFO (First in First Out) instead of LIFO (Last in First out)
local bindable = Instance.new("BindableEvent")
local signal = require("Path to SomeSignal")()
for _, v in {"a", "b", "c", "d"} do
local function printValue()
print(v)
end
bindable.Event:Connect(printValue)
signal:Connect(printValue)
end
print("SOMESIGNAL FIRE")
signal:Fire() -- a, b, c, d
print("BINDABLE FIRE")
bindable:Fire() -- d, c, b, a
-
Mutation queue which prevents undesired effects when trying to alter connection / signal state mid-fire, you can opt out by using methods with
-Nowsuffix (provided that you didn’t callDiscardAllMutationsbefore that) -
Fires are queued when signal is firing, prevents having processed mutations from other fire altering the original fires mutations
^ But because it yields (because it needs to queue), there’sFireAsyncmethod
^^ There’sFireNowincase you need to fire without it being queued, but runs on seperate mutation queue
^^^ Incase you do not need queued fires anymore, you can callDiscardQueuedFiresmethod -
When disconnecting
Waitconnection, thread gets resumes with no parameters
local signal = require("Path to SomeSignal")()
task.defer(signal.Fire, signal, "ran")
signal:Connect(function(...)
print(...)
signal:DisconnectConnectedNow()
end)
local data = signal:Wait()
print(data) -- nil, previous connection disconnected :Wait() connection
- Opt-in priority insertion, lets you choose the order of which connections are ran in
^ By default it’sNormalInsert(which uses lowest priority in signal, or default priority when it’s the only connection), so is when connecting/reconnecting with -Now suffix
^^ Like FIFO run order, this runs from highest priority to lowest priority
local signal = require("Path to SomeSignal")()
signal:Connect(function()
print("f")
end)
signal:Connect(function()
print("a")
end, 3)
signal:Connect(function()
print("b")
end, 4)
signal:Connect(function()
print("c")
end)
signal:Connect(function()
print("d")
end, -10)
signal:Connect(function()
print("e")
end)
signal:Fire() -- b, a, f, c, d, e
- There is no
DisconnectAll, it’s been replaced byDisconnectConnected&DisconnectQueued
^DisconnectConnecteddisconnects all currently connected connections
^^DisconnectQueueddisconnects queued connections which are waiting to be connected (ie. in mutation queue)







