←back to thread

116 points doekenorg | 1 comments | | HN request time: 0.208s | source
Show context
donatj ◴[] No.44498833[source]
I have read much about Fibers since they were introduced and have never come up with a real use case.

All the examples I find are like the trivial ones here where it just feels like instead of jamming a bunch of code into a single messy function that yields, you'd be better off particularly from a static analysis standpoint just having ordered method calls or chained callables where each step returns the next step as a callable.

I've yet to see a use case where I can't come up with a safer way to do it without Fibers, but I would love if someone could enlighten me because I feel like I am absolutely missing something.

replies(4): >>44499326 #>>44499413 #>>44499430 #>>44502332 #
1. hibikir ◴[] No.44499430[source]
I have a service using them a lot. It ultimately relies on a couple dozen downstream dba and endpoints, with some calls requiring strict dependencies, and others running in parallel. So I just draw the dependency chart among the functions, and let the service manage all the parallelism and asynchronous bits with minimal babysitting. If it was all chained, then sure, it's not a significant gain