Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Deferred/Adapted Signal using Lua #463

Open
lucasmz-dev opened this issue Apr 29, 2024 · 1 comment
Open

Implement Deferred/Adapted Signal using Lua #463

lucasmz-dev opened this issue Apr 29, 2024 · 1 comment

Comments

@lucasmz-dev
Copy link

What package is this for?
Signal

Describe your problem
Currently, Signal by defaults uses GoodSignal which has some issues but is nice, but it also has the option of the older standard that uses BindableEvents. BindableEvents allow for Deferred (Adaptive) behavior which is important, GoodSignal doesn't. At the same time however, BindableEvents suck. They cause memory leaks which may not be detected by the user.

Describe the solution you'd like

We should abandon the BindableEvent approach. It is slower, leakier, just plain worse. We now have the power of Lua Signals, have had so for a long time. But it is also important to implement Deferred behavior.

We have task.defer, and it is also possible to infer what mode the game is in with some simple code.
I did this in my Signal library which is useful to implementing this. You can use it if you like (I don't maintain it, running Linux can't anymore, it doesn't have the same typing as sleitnick's fork for example) or fork/use the ideas/code from there. (I think so anyway? I haven't looked at licenses for a while but I can probably change it for this if it is an issue)

Thank you for your time.

@lucasmz-dev
Copy link
Author

Furthermore, devs testing Deferred behavior with how it works right now might make some issues appear that are hard to debug, such as race conditions, or issues with expectation of order, as events from the game itself, would run in Deferred, while Nevermore's Signal would be running Immediate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant