Skip to content

Cleanup Subs#798

Merged
dmjio merged 13 commits intomasterfrom
cleanup-subs
Mar 12, 2025
Merged

Cleanup Subs#798
dmjio merged 13 commits intomasterfrom
cleanup-subs

Conversation

@dmjio
Copy link
Copy Markdown
Owner

@dmjio dmjio commented Mar 12, 2025

  • Create 'ComponentState' to house component lifetime
  • Add top-level 'unmount' function
  • Remove duplicate calls to 'sink'
  • Kill all threads associated with a 'Sub' on component unmount.
  • Add example to component to show Sub cleanup
  • Sink initial action after forking event loop
  • Remove BlockedIndefinitelyOnMVar hack (now that we store Sink action in a global IORef
  • Use proper mount points, document top-level functions w/ mounting.
  • Move type Sink a = a -> IO () to type Sink a = a -> JSM ()

dmjio added 2 commits March 12, 2025 15:12
Multiple calls to registerSink will combine Sub threads.
- Don't call registerSink multiple times
- Add example to components
- Removes insertWith on registerSink
dmjio added 7 commits March 12, 2025 16:59
Now that we have ComponentMap Sink will never be GC'd.
- Add loggerSub to components example
- Callback release is not getting used, and is getting GC'd by JS / the
GHC RTS.

- Remove superflous calls toJSVal
@dmjio dmjio merged commit f325743 into master Mar 12, 2025
@dmjio dmjio deleted the cleanup-subs branch March 12, 2025 23:57
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