I got your point, and I’ve provided an example to show why nobody uses Stream.resource
for managing resources and why it’s actually a bad idea. Stream.resource
is an optimistic way to manage resources, and it has a lot of flaws (like leaving resource open in case of infinite recursion bug, memory limit, etc.) . As I’ve said, an idiomatic way to manage resources is using a separate monitoring process.
2 Likes