© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
Handling Cleanup After Calling `resume` in `Effect.async` - Effect Community
EC
Effect Community
•
8mo ago
Renato L.
Handling Cleanup After Calling `resume` in `Effect.async`
I have a third party function that takes a callback and returns an unsubscribe function
.
I think the best approach to wrap into an effect is to use
Effect.async
Effect.async
, calling
resume
resume
, and I understand that I can return an
Effect
Effect
for cleaning up and unsubscribing if the fiber is interrupted
.
Simple question
, can I call the unsubscribe after calling resume
? Or do I need another strategy for the cleanup when there is no interrupting
?
Effect Community
Join
Production-grade applications in TypeScript.
6,221
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Title: Handling Asynchronous Validation in Effect Typescript Schema
EC
Effect Community / 🚀-beginners
9mo ago
Handling Cleanup in Stream.flatMap with `{ switch: true }`
EC
Effect Community / 🚀-beginners
3y ago
Handling Errors in Effect.Effect Program
EC
Effect Community / 🚀-beginners
5mo ago
Handling TCP Socket Events with Effect and Stream.async
EC
Effect Community / 🚀-beginners
9mo ago