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

feat: generator improvements, vanilla events (for performance), allow triggering initial state side effects, minor bindings fixes #17

Merged
merged 2 commits into from
Oct 7, 2023

Conversation

jolexxa
Copy link
Member

@jolexxa jolexxa commented Oct 5, 2023

A number of small improvements:

  • Generator no longer needs to know about the Input or Output inner classes of a logic block — it'll just infer the existence of an input or output based on usage, potentially allowing for a less generic and more versatile API in a future release.
  • Removed WeakEvent for the sake of performance and API usage. Looked like it was allocating a list on every invocation. Would rather just use .NET's underlying Multicast delegates that power vanilla C# events.
  • Bindings now unsubscribe input and error event channels — was a small oversight.
  • Added a public API method Start() to LogicBlock and LogicBlockAsync so that you can trigger OnEnter callbacks to run on the initial state. There's a lot of times you want to get those side effects after you've setup bindings so that you don't have to write a lot of redundant glue code to configure whatever is binding to the logic block.
  • Added test case showing that structs can be used for inputs and outputs. Using structs for outputs should prevent them from ever having to hit the heap, meaning you could spam producing struct outputs as much as you want. 😀

@jolexxa jolexxa merged commit a2d34a4 into main Oct 7, 2023
4 checks passed
@jolexxa jolexxa deleted the feat/improvements branch February 29, 2024 00:52
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 this pull request may close these issues.

1 participant